module ActsAsFollower::FollowScopes

Public Instance Methods

blocked() click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 33
def blocked
  where(:blocked => true)
end
descending() click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 25
def descending
  order("follows.created_at DESC")
end
for_followable(followable) click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 9
def for_followable(followable)
  where(:followable_id => followable.id, :followable_type => parent_class_name(followable))
end
for_followable_type(followable_type) click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 17
def for_followable_type(followable_type)
  where(:followable_type => followable_type)
end
for_follower(follower) click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 4
def for_follower(follower)
  where(:follower_id => follower.id,
        :follower_type => parent_class_name(follower))
end
for_follower_type(follower_type) click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 13
def for_follower_type(follower_type)
  where(:follower_type => follower_type)
end
recent(from) click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 21
def recent(from)
  where(["created_at > ?", (from || 2.weeks.ago).to_s(:db)])
end
unblocked() click to toggle source
# File lib/acts_as_follower/follow_scopes.rb, line 29
def unblocked
  where(:blocked => false)
end