motion/model/model.rb
def set_belongs_to_attr(col, owner, options = {})
      _col = column(col)
      unless belongs_to_synced?(_col, owner)
        _set_attr(_col.name, owner)
        rebuild_relation(_col, owner, set_inverse: options[:set_inverse])
        if _col.polymorphic
          set_polymorphic_attr(_col.name, owner)
        else
          _set_attr(_col.foreign_key, owner ? owner.id : nil)
        end
      end

      owner
    end
def set_belongs_to_attr(col, owner, options = {})
      _col = column(col)
      unless belongs_to_synced?(_col, owner)
        _set_attr(_col.name, owner)
        rebuild_relation(_col, owner, set_inverse: options[:set_inverse])
        if _col.polymorphic
          set_polymorphic_attr(_col.name, owner)
        else
          _set_attr(_col.foreign_key, owner ? owner.id : nil)
        end
      end

      owner
    end
def set_belongs_to_attr ( col , owner , options = { } ) _col = column ( col ) unless belongs_to_synced? ( _col , owner ) _set_attr ( _col . name , owner ) rebuild_relation ( _col , owner , set_inverse : options [ :set_inverse ] ) if _col . polymorphic set_polymorphic_attr ( _col . name , owner ) else _set_attr ( _col . foreign_key , owner ? owner . id : nil ) end end owner end
Associate the owner but without rebuilding the inverse assignment
Associate the owner but without rebuilding the inverse assignment