class ActiveRecord::Relation::HashMerger

:nodoc:

def initialize(relation, hash)

def initialize(relation, hash)
  hash.assert_valid_keys(*Relation::VALUE_METHODS)
  @relation = relation
  @hash     = hash
end

def merge

def merge
  Merger.new(relation, other).merge
end

def other

the values.
build a relation to merge in rather than directly merging
interpolation might take place for where values. So we should
Applying values to a relation has some side effects. E.g.
def other
  other = Relation.create(
    relation.model,
    table: relation.table,
    predicate_builder: relation.predicate_builder
  )
  hash.each do |k, v|
    k = :_select if k == :select
    if Array === v
      other.public_send("#{k}!", *v)
    else
      other.public_send("#{k}!", v)
    end
  end
  other
end