From 5ca81c3fbcb70fda7e625e03bb2644643abe78bd Mon Sep 17 00:00:00 2001 From: Chris Bielinski Date: Thu, 16 Apr 2015 15:12:22 -0700 Subject: [PATCH] Update followable.rb Backported #followers_scoped --- lib/acts_as_follower/followable.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/acts_as_follower/followable.rb b/lib/acts_as_follower/followable.rb index 7582859..851afc0 100644 --- a/lib/acts_as_follower/followable.rb +++ b/lib/acts_as_follower/followable.rb @@ -59,6 +59,11 @@ def blocked_followers_count self.followings.blocked.count end + # Returns the following scope. + def followers_scoped(options={}) + self.followings.unblocked.includes(:follower) + end + # Returns the following records. def followers(options={}) self.followings.unblocked.includes(:follower).all(options).collect{|f| f.follower}