1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

dup rather than create so many arrays

This commit is contained in:
Aaron Patterson 2010-10-19 17:51:46 -07:00
parent dc16163d06
commit 8d5829f149

View file

@ -26,14 +26,14 @@ module ActiveRecord
merged_relation = merged_relation.joins(r.joins_values)
merged_wheres = @where_values
merged_wheres = @where_values.dup
r.where_values.each do |w|
if w.respond_to?(:operator) && w.operator == :==
merged_wheres = merged_wheres.reject {|p| p.respond_to?(:operator) && p.operator == :== && p.operand1.name == w.operand1.name }
end
merged_wheres += [w]
merged_wheres << w
end
merged_relation.where_values = merged_wheres