Permalink
Browse files

use regular ruby for fewer method calls. we do not need 🎁s!

  • Loading branch information...
1 parent 3008188 commit 9ef701d659bb4015e926994c166977b07dbfc2db @tenderlove tenderlove committed Feb 25, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 activerecord/lib/active_record/relation/spawn_methods.rb
View
5 activerecord/lib/active_record/relation/spawn_methods.rb
@@ -24,7 +24,10 @@ def merge(r)
(Relation::MULTI_VALUE_METHODS - [:joins, :where, :order]).each do |method|
value = r.send(:"#{method}_values")
- merged_relation.send(:"#{method}_values=", merged_relation.send(:"#{method}_values") + value) if value.present?
+ next if value.empty?
+
+ value += merged_relation.send(:"#{method}_values")
+ merged_relation.send :"#{method}_values=", value
end
merged_relation.joins_values += r.joins_values

1 comment on commit 9ef701d

@bjeanes

But, I want presents...

Please sign in to comment.