diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-06-28 22:33:10 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-29 17:57:06 +0200 |
commit | dabf74b4950f486075b380f2406ede9fa67606db (patch) | |
tree | d50edb855eacb12b3fe013e54b231d5d666c147c /activerecord/lib | |
parent | e8f88a3298441c0421258a429376540870b8149e (diff) | |
download | rails-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/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/spawn_methods.rb | 2 |
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 |