method
add_to_target
v6.1.3.1 -
Show latest stable
- Class:
ActiveRecord::Associations::CollectionAssociation
add_to_target(record, skip_callbacks: false, replace: false, &block)public
No documentation available.
# File activerecord/lib/active_record/associations/collection_association.rb, line 281
def add_to_target(record, skip_callbacks: false, replace: false, &block)
if replace || association_scope.distinct_value
index = @target.index(record)
end
replace_on_target(record, index, skip_callbacks, &block)
end