instance method inverse_polymorphic_association_changed?

Ruby on Rails 8.0.4

Since v7.1.6 Private

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

Signature

inverse_polymorphic_association_changed?(reflection, record)

No documentation comment.

Parameters

reflection req
record req
Source
# File activerecord/lib/active_record/autosave_association.rb, line 526
      def inverse_polymorphic_association_changed?(reflection, record)
        return false unless reflection.inverse_of&.polymorphic?

        class_name = record._read_attribute(reflection.inverse_of.foreign_type)
        reflection.active_record.polymorphic_name != class_name
      end

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