base/app/models/actor.rb in social_stream-0.27.3 vs base/app/models/actor.rb in social_stream-0.28.0

- old
+ new

@@ -3,11 +3,11 @@ # # Actors are the nodes of a social network. Two actors are linked by {Tie Ties}. The # type of a {Tie} is a {Relation}. Each actor can define and customize their relations own # {Relation Relations}. # -# Every {Actor} has an Avatar, a {Profile} with personal o group information, contact data, etc. +# Every {Actor} has an Avatar, a {Profile} with personal or group information, contact data, etc. # # {Actor Actors} perform {ActivityAction actions} (like, suscribe, etc.) on # {ActivityObject activity objects} ({Post posts}, {Comment commments}, pictures, events..) # # = Actor subtypes @@ -78,9 +78,22 @@ :dependent => :destroy has_many :followings, :through => :sent_actions, :source => :activity_object, :conditions => { 'activity_actions.follow' => true } + + has_many :authored_activities, + :class_name => "Activity", + :foreign_key => :author_id, + :dependent => :destroy + has_many :user_authored_activities, + :class_name => "Activity", + :foreign_key => :user_author_id, + :dependent => :destroy + has_many :owned_activities, + :class_name => "Activity", + :foreign_key => :owner_id, + :dependent => :destroy scope :alphabetic, order('actors.name') scope :letter, lambda { |param| if param.present?