instance method _record_changed?

Ruby on Rails edge

Since v7.0.10 Private — implementation detail, not part of the public API

Available in: v7.0.10 v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

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 515
      def _record_changed?(reflection, record, key)
        record.new_record? ||
          (association_foreign_key_changed?(reflection, record, key) ||
          inverse_polymorphic_association_changed?(reflection, record)) ||
          ActiveRecord::Key.for(reflection.foreign_key).any? { |fk| record.will_save_change_to_attribute?(record.class.attribute_aliases[fk] || fk) }
      end

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

Defined in ActiveRecord::AutosaveAssociation

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close