method
inverse_polymorphic_association_changed?
v7.2.3 -
Show latest stable
- Class:
ActiveRecord::AutosaveAssociation
inverse_polymorphic_association_changed?(reflection, record)private
No documentation available.
# File activerecord/lib/active_record/autosave_association.rb, line 491
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