Module: Mongoid::Followable::ClassMethods

Defined in:
lib/mongoid_followable/followable.rb

Instance Method Summary collapse

Instance Method Details

#followees_of(model) ⇒ Object

get certain model’s followees of this type

Example:

>> @jim = User.new
>> @ruby = Group.new
>> @jim.save
>> @ruby.save

>> @jim.follow(@ruby)
>> User.followees_of(@jim)
=> [@ruby]

Arguments:
  model: instance of some followable model


28
29
30
# File 'lib/mongoid_followable/followable.rb', line 28

def followees_of(model)
  model.followees_by_type(self.name)
end