instance method association_foreign_key_changed?

Ruby on Rails 6.1.7.10

Since v5.2.8.1 Private

Available in: v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

association_foreign_key_changed?(reflection, record, key)

No documentation comment.

Parameters

reflection req
record req
key req
Source
# File activerecord/lib/active_record/autosave_association.rb, line 485
      def association_foreign_key_changed?(reflection, record, key)
        return false if reflection.through_reflection?

        record._has_attribute?(reflection.foreign_key) && record._read_attribute(reflection.foreign_key) != key
      end

Defined in activerecord/lib/active_record/autosave_association.rb line 485 · 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