Module: FollowSystem::Followee
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/follow_system/followee.rb
Overview
Followee module
This module defines followee behavior in follow system
Instance Method Summary collapse
-
#followed_by?(follower) ⇒ Boolean
Specifies if self is followed by a Follower object.
- #followers_by(klass) ⇒ ActiveRecord::Relation
-
#is_followee? ⇒ Boolean
Specifies if self can be followed by Follower objects.
Instance Method Details
#followed_by?(follower) ⇒ Boolean
Specifies if self is followed by a FollowSystem::Follower object
43 44 45 |
# File 'lib/follow_system/followee.rb', line 43 def followed_by?(follower) Follow.follows?(follower, self) end |
#followers_by(klass) ⇒ ActiveRecord::Relation
Retrieves a scope of FollowSystem::Follow objects that follows self filtered FollowSystem::Follower type
53 54 55 |
# File 'lib/follow_system/followee.rb', line 53 def followers_by(klass) Follow.scope_by_followee(self).scope_by_follower_type(klass) end |
#is_followee? ⇒ Boolean
Specifies if self can be followed by FollowSystem::Follower objects
33 34 35 |
# File 'lib/follow_system/followee.rb', line 33 def is_followee? true end |