instance method
association_foreign_key_changed?
Ruby on Rails 5.2.8.1
Since v5.2.8.1 PrivateSignature
association_foreign_key_changed?(reflection, record, key)
No documentation comment.
Parameters
-
reflectionreq -
recordreq -
keyreq
Source
# File activerecord/lib/active_record/autosave_association.rb, line 468
def association_foreign_key_changed?(reflection, record, key)
return false if reflection.through_reflection?
record.has_attribute?(reflection.foreign_key) && record[reflection.foreign_key] != key
end
Defined in activerecord/lib/active_record/autosave_association.rb line 468
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AutosaveAssociation