instance method
record_changed?
Ruby on Rails 4.0.13
Since v4.0.13 Last seen in v6.1.7.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 402
def record_changed?(reflection, record, key)
record.new_record? || record[reflection.foreign_key] != key || record.changed_attributes.include?(reflection.foreign_key)
end
Defined in activerecord/lib/active_record/autosave_association.rb line 402
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::AutosaveAssociation