instance method _record_changed?

Ruby on Rails 7.2.3

Since v7.0.10 Private

Available in: v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

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 475
      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 475 · 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