instance method
_record_changed?
Ruby on Rails 8.1.2
Since v7.0.10 PrivateSignature
_record_changed?(reflection, record, key)
If the record is new or it has changed, returns true.
Parameters
-
reflectionreq -
recordreq -
keyreq
Source
# File activerecord/lib/active_record/autosave_association.rb, line 510
def _record_changed?(reflection, record, key)
record.new_record? ||
(association_foreign_key_changed?(reflection, record, key) ||
inverse_polymorphic_association_changed?(reflection, record)) ||
record.will_save_change_to_attribute?(reflection.foreign_key)
end
Defined in activerecord/lib/active_record/autosave_association.rb line 510
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AutosaveAssociation