Module: SocialEngine::Friendable::InstanceMethods
- Defined in:
- app/models/social_engine/friendable.rb
Instance Method Summary collapse
- #add_friend(user) ⇒ Object
- #friendable? ⇒ Boolean
- #friends(expire_association_cache = false) ⇒ Object
Instance Method Details
#add_friend(user) ⇒ Object
49 50 51 52 |
# File 'app/models/social_engine/friendable.rb', line 49 def add_friend(user) Friending.create(:friendor_id=>self.id, :friendee_id=>user.id, :confirmed=>!SocialEngineYetting.confirm_friends) end |
#friendable? ⇒ Boolean
40 41 42 |
# File 'app/models/social_engine/friendable.rb', line 40 def friendable? true end |
#friends(expire_association_cache = false) ⇒ Object
44 45 46 47 |
# File 'app/models/social_engine/friendable.rb', line 44 def friends(expire_association_cache=false) return self.friendors(true) + self.friendees(true) if expire_association_cache self.friendors + self.friendees end |