Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow calling all_followings with options (passed to ActiveRecord)

For example:

User.first.all_following(:limit => 5, :order => "id desc")
  • Loading branch information...
commit 656fc7fd87d4077259693c1c33d5690666e29bab 1 parent 131d8ae
@gaizka authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/acts_as_follower.rb
View
6 lib/acts_as_follower.rb
@@ -57,12 +57,12 @@ def follows_by_type(followable_type)
# Returns the follow records related to this instance with the followable included.
def all_follows
- self.follows.unblocked.all(:include => :followable)
+ self.follows.unblocked.scoped(:include => :followable)
end
# Returns the actual records which this instance is following.
- def all_following
- all_follows.collect{ |f| f.followable }
+ def all_following(options={})
+ all_follows.all(options).collect{ |f| f.followable }
end
# Returns the actual records of a particular type which this record is following.
Please sign in to comment.
Something went wrong with that request. Please try again.