aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-06-28 22:33:10 -0400
committerJosé Valim <jose.valim@gmail.com>2010-06-29 17:57:06 +0200
commitdabf74b4950f486075b380f2406ede9fa67606db (patch)
treed50edb855eacb12b3fe013e54b231d5d666c147c /activerecord
parente8f88a3298441c0421258a429376540870b8149e (diff)
downloadrails-dabf74b4950f486075b380f2406ede9fa67606db.tar.gz
rails-dabf74b4950f486075b380f2406ede9fa67606db.tar.bz2
rails-dabf74b4950f486075b380f2406ede9fa67606db.zip
array subtraction should be faster than iterating over all the elements
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/spawn_methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/spawn_methods.rb b/activerecord/lib/active_record/relation/spawn_methods.rb
index bb1f138f5b..7712ad2569 100644
--- a/activerecord/lib/active_record/relation/spawn_methods.rb
+++ b/activerecord/lib/active_record/relation/spawn_methods.rb
@@ -6,7 +6,7 @@ module ActiveRecord
merged_relation = clone
return merged_relation unless r
- (Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS).reject {|m| [:joins, :where].include?(m)}.each do |method|
+ ((Relation::ASSOCIATION_METHODS + Relation::MULTI_VALUE_METHODS) - [:joins, :where]).each do |method|
value = r.send(:"#{method}_values")
merged_relation.send(:"#{method}_values=", value) if value.present?
end