method
association_foreign_key_changed?
v7.0.0 -
Show latest stable
- Class:
ActiveRecord::AutosaveAssociation
association_foreign_key_changed?(reflection, record, key)private
No documentation available.
# File activerecord/lib/active_record/autosave_association.rb, line 470
def association_foreign_key_changed?(reflection, record, key)
return false if reflection.through_reflection?
record._has_attribute?(reflection.foreign_key) && record._read_attribute(reflection.foreign_key) != key
end