method
target=
rails latest stable - Class:
ActiveRecord::Associations::CollectionAssociation
target=(record)public
No documentation available.
# File activerecord/lib/active_record/associations/collection_association.rb, line 281
def target=(record)
return super unless reflection.klass.has_many_inversing
case record
when nil
# It's not possible to remove the record from the inverse association.
when Array
super
else
replace_on_target(record, true, replace: true, inversing: true)
end
end