class ActiveRecord::Relation::HashMerger
def other
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