Sha256: af9c03ef330bc3b6cc6704e7bea5ca957d671679db8f52328831aa5ab9aa383d

Contents?: true

Size: 777 Bytes

Versions: 2

Compression:

Stored size: 777 Bytes

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 }

        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))
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
social_stream-0.25.0 base/lib/social_stream/models/object.rb
social_stream-base-0.19.0 lib/social_stream/models/object.rb