motion/model/model.rb
def belongs_to_synced?(col, owner)
      # The :belongs_to that points to the instance has changed
      return false if get_belongs_to_attr(col) != owner

      # The polymorphic reference (_type, _id) columns do not match, maybe it was just saved
      return false if col.polymorphic && !polymorphic_attr_matches?(col, owner)

      # The key reference (_id) column does not match, maybe it was just saved
      return false if _get_attr(col.foreign_key) != owner.try(:id)

      true
    end
def belongs_to_synced?(col, owner)
      # The :belongs_to that points to the instance has changed
      return false if get_belongs_to_attr(col) != owner

      # The polymorphic reference (_type, _id) columns do not match, maybe it was just saved
      return false if col.polymorphic && !polymorphic_attr_matches?(col, owner)

      # The key reference (_id) column does not match, maybe it was just saved
      return false if _get_attr(col.foreign_key) != owner.try(:id)

      true
    end
Determine if the :belongs_to relationship is synchronized. Checks the instance and the DB column attributes.