method
add_record_to_target_with_callbacks
rails latest stable - Class:
ActiveRecord::Associations::AssociationCollection
add_record_to_target_with_callbacks(record)protected
No documentation available.
# File activerecord/lib/active_record/associations/association_collection.rb, line 478
def add_record_to_target_with_callbacks(record)
callback(:before_add, record)
yield(record) if block_given?
@target ||= [] unless loaded?
if index = @target.index(record)
@target[index] = record
else
@target << record
end
callback(:after_add, record)
set_inverse_instance(record, @owner)
record
end