Skip to content

Instantly share code, notes, and snippets.

@bryanmikaelian
Created March 7, 2013 14:42
Show Gist options
  • Save bryanmikaelian/5108488 to your computer and use it in GitHub Desktop.
Save bryanmikaelian/5108488 to your computer and use it in GitHub Desktop.
def friends_circles(circle_limit = 1)
circles = []
@followings = self.followings.includes(:user)
self.followings.each do |following|
circles << following.user.circles.limit(circle_limit).first
end
circles.reject { |c| self.member_of?(c) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment