aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-24 16:55:11 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-24 16:55:22 -0800
commit9ef701d659bb4015e926994c166977b07dbfc2db (patch)
tree03fd4b636f9ea857b858707d5fecb6ad0af527cb /activerecord
parent3008188cd6c0cca8789e8b7c57a4f896e2ff07d5 (diff)
downloadrails-9ef701d659bb4015e926994c166977b07dbfc2db.tar.gz
rails-9ef701d659bb4015e926994c166977b07dbfc2db.tar.bz2
rails-9ef701d659bb4015e926994c166977b07dbfc2db.zip
use regular ruby for fewer method calls. we do not need :gift:s!
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index 7131aa29b6..706b0cd1cc 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -24,7 +24,10 @@ module ActiveRecord
(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