Module: ActiveRecord::Acts::MuckAggregationOwner::ClassMethods

Defined in:
lib/active_record/acts/muck_aggregation_owner.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_muck_aggregation_ownerObject

acts_as_muck_aggregation_owner adds identity aggregations to a given object. The aggregations attached to the object in this way are then assumed to be produced by the object. For example, if a user writes a blog the blog could be associated with the user in this way.



14
15
16
17
18
# File 'lib/active_record/acts/muck_aggregation_owner.rb', line 14

def acts_as_muck_aggregation_owner
  has_many :aggregations, :as => :ownable
  include ActiveRecord::Acts::MuckAggregationOwner::InstanceMethods
  extend ActiveRecord::Acts::MuckAggregationOwner::SingletonMethods
end