Module: ActivityStream::HasManyAssociation

Defined in:
lib/activity_stream.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/activity_stream.rb', line 186

def self.included(base)
  base.class_eval do
    def add_record_to_target_with_callbacks_with_indirect_object(record, &block)
      tag_with_indirect_object record
      add_record_to_target_with_callbacks_without_indirect_object record, &block
    end
    alias_method_chain :add_record_to_target_with_callbacks, :indirect_object
    
    def find_target_with_indirect_object
      records = find_target_without_indirect_object
      records.each { |record| tag_with_indirect_object(record) }
      records
    end
    alias_method_chain :find_target, :indirect_object
  end
  
end