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:
parent
dc16163d06
commit
8d5829f149
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue