Permalink
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...
gaizka committed Nov 17, 2009
1 parent 131d8ae commit 656fc7fd87d4077259693c1c33d5690666e29bab
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/acts_as_follower.rb
View
@@ -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.

0 comments on commit 656fc7f

Please sign in to comment.