instance method record_changed?

Ruby on Rails 6.1.7.10

Since v4.0.13 Last seen in v6.1.7.10 Private

Available in: v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10

Signature

record_changed?(reflection, record, key)

If the record is new or it has changed, returns true.

Parameters

reflection req
record req
key req
Source
# File activerecord/lib/active_record/autosave_association.rb, line 479
      def record_changed?(reflection, record, key)
        record.new_record? ||
          association_foreign_key_changed?(reflection, record, key) ||
          record.will_save_change_to_attribute?(reflection.foreign_key)
      end

Defined in activerecord/lib/active_record/autosave_association.rb line 479 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::AutosaveAssociation

Type at least 2 characters to search.

↑↓ navigate · open · esc close