Sha256: 5dbcc22f6f3b67c13dcc9c64f5f0ea9a67c75c05f675f5e8036bedbeeeaf96c0
Contents?: true
Size: 1.75 KB
Versions: 27
Compression:
Stored size: 1.75 KB
Contents
module SocialStream module Models # Additional features for models that are Activity Objects module Object extend ActiveSupport::Concern included do subtype_of :activity_object, :build => { :object_type => to_s } has_many :received_actions, :through => :activity_object has_many :activity_object_audiences, :through => :activity_object unless self == Actor validates_presence_of :author_id, :owner_id, :user_author_id after_create :create_post_activity # Disable update activity for now # It usually appears repeated in the wall and provides no useful information #after_update :create_update_activity end scope :authored_by, lambda { |subject| joins(:activity_object). merge(ActivityObject.authored_by(subject)) } scope :not_authored_by, lambda { |subject| joins(:activity_object). merge(ActivityObject.not_authored_by(subject)) } scope :owned_by, lambda { |subject| joins(:activity_object). merge(ActivityObject.owned_by(subject)) } scope :shared_with, lambda { |subject| joins(:activity_object). merge(ActivityObject.shared_with(subject)) } scope :followed_by, lambda { |subject| joins(:activity_object). merge(ActivityObject.followed_by(subject)) } # Strong parameters include ActiveModel::ForbiddenAttributesProtection end module ClassMethods # Nothing here by the moment, but methods are added by other # SocialStream's components, such as Ostatus end end end end
Version data entries
27 entries across 27 versions & 2 rubygems