# File lib/dm-core/query.rb, line 32
    def update(other)
      assert_kind_of 'other', other, self.class, Hash

      assert_valid_other(other)

      if other.kind_of?(Hash)
        return self if other.empty?
        other = self.class.new(@repository, model, other)
      end

      return self if self == other

      # TODO: update this so if "other" had a value explicitly set
      #       overwrite the attributes in self

      # only overwrite the attributes with non-default values
      @reload       = other.reload?       unless other.reload?       == false
      @unique       = other.unique?       unless other.unique?       == false
      @offset       = other.offset        if other.reload? || other.offset != 0
      @limit        = other.limit         unless other.limit         == nil
      @order        = other.order         unless other.order         == model.default_order
      @add_reversed = other.add_reversed? unless other.add_reversed? == false
      @fields       = other.fields        unless other.fields        == @properties.defaults
      @links        = other.links         unless other.links         == []
      @includes     = other.includes      unless other.includes      == []

      update_conditions(other)

      self
    end