mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
array subtraction should be faster than iterating over all the elements
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
e8f88a3298
commit
dabf74b495
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ module ActiveRecord
|
||||||
merged_relation = clone
|
merged_relation = clone
|
||||||
return merged_relation unless r
|
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")
|
value = r.send(:"#{method}_values")
|
||||||
merged_relation.send(:"#{method}_values=", value) if value.present?
|
merged_relation.send(:"#{method}_values=", value) if value.present?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue