Module | MuckActivity::ActMethods |
In: |
lib/muck_activity.rb
|
acts_as_activity_source gives the class it is called on a method called add_activity that can add activities into a feed.
# File lib/muck_activity.rb, line 24 24: def acts_as_activity_source 25: unless included_modules.include? InstanceMethods 26: include InstanceMethods 27: end 28: end
has_activities gives the class it is called on an activity feed and a method called add_activity that can add activities into a feed. Retrieve activity feed items via object.activities. ie @user.activities.
# File lib/muck_activity.rb, line 14 14: def has_activities 15: unless included_modules.include? InstanceMethods 16: has_many :activity_feeds, :as => :ownable 17: has_many :activities, :through => :activity_feeds, :order => 'created_at desc' 18: include InstanceMethods 19: end 20: end