Module: MentionSystem::Mentionee
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/mention_system/mentionee.rb
Overview
Mentionee module
This module defines mentionee behavior in mention system
Instance Method Summary collapse
-
#is_mentionee? ⇒ Boolean
Specifies if self can be mentioned by Mentioner objects.
-
#mentioned_by?(mentioner) ⇒ Boolean
Specifies if self is mentioned by a Mentioner object.
- #mentioners_by(klass) ⇒ ActiveRecord::Relation
Instance Method Details
#is_mentionee? ⇒ Boolean
Specifies if self can be mentioned by MentionSystem::Mentioner objects
33 34 35 |
# File 'lib/mention_system/mentionee.rb', line 33 def is_mentionee? true end |
#mentioned_by?(mentioner) ⇒ Boolean
Specifies if self is mentioned by a MentionSystem::Mentioner object
43 44 45 |
# File 'lib/mention_system/mentionee.rb', line 43 def mentioned_by?(mentioner) Mention.mentions?(mentioner, self) end |
#mentioners_by(klass) ⇒ ActiveRecord::Relation
Retrieves a scope of MentionSystem::Mention objects that mentions self filtered MentionSystem::Mentioner type
53 54 55 |
# File 'lib/mention_system/mentionee.rb', line 53 def mentioners_by(klass) Mention.scope_by_mentionee(self).scope_by_mentioner_type(klass) end |