Module: Mongo::Followable::Followed::ClassMethods

Defined in:
lib/mongo_followable/followed.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


31
32
33
# File 'lib/mongo_followable/followed.rb', line 31

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