method

association_foreign_key_changed?

Importance_0
v7.1.3.2 - Show latest stable - 0 notes - Class: ActiveRecord::AutosaveAssociation
association_foreign_key_changed?(reflection, record, key) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/autosave_association.rb, line 482
      def association_foreign_key_changed?(reflection, record, key)
        return false if reflection.through_reflection?

        foreign_key = Array(reflection.foreign_key)
        return false unless foreign_key.all? { |key| record._has_attribute?(key) }

        foreign_key.map { |key| record._read_attribute(key) } != Array(key)
      end
Register or log in to add new notes.