Permalink
Browse files

dup rather than create so many arrays

  • Loading branch information...
1 parent c681df4 commit 4fd9c20fb369aa03e8d92e8c380d6ef663439f9a @tenderlove tenderlove committed Oct 20, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/lib/active_record/relation/spawn_methods.rb
@@ -35,14 +35,14 @@ def merge(r)
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

0 comments on commit 4fd9c20

Please sign in to comment.