Class: ActivityObject
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ActivityObject
- Includes:
- SocialStream::Models::Supertype
- Defined in:
- app/models/activity_object.rb
Overview
The ActivityObject is any object that receives actions. Examples are creating post, liking a comment, contacting a user.
ActivityObject subtypes
All post, comment and user are objects. Social Stream privides 3 ActivityObject subtypes, Post, Comment and Actor. The application developer can define as many ActivityObject subtypes as required. Objects are added to config/initializers/social_stream.rb
Instance Method Summary collapse
-
#object ⇒ Object
The object of this activity object.
-
#post_activity ⇒ Object
The activity in which this activity_object was created.
Instance Method Details
#object ⇒ Object
The object of this activity object
22 23 24 25 |
# File 'app/models/activity_object.rb', line 22 def object subtype_instance || actor.try(:subject) end |
#post_activity ⇒ Object
The activity in which this activity_object was created
28 29 30 |
# File 'app/models/activity_object.rb', line 28 def post_activity activities.includes(:activity_verb).where('activity_verbs.name' => 'post').first end |