mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
intersection between a relation and an array works in both directions
Signed-off-by: Mikel Lindsaar <raasdnil@gmail.com>
This commit is contained in:
parent
1c283765b6
commit
a513f8f8bb
1 changed files with 1 additions and 0 deletions
|
@ -5,6 +5,7 @@ module ActiveRecord
|
|||
def merge(r)
|
||||
merged_relation = clone
|
||||
return merged_relation unless r
|
||||
return to_a & r if r.is_a?(Array)
|
||||
|
||||
Relation::ASSOCIATION_METHODS.each do |method|
|
||||
value = r.send(:"#{method}_values")
|
||||
|
|
Loading…
Reference in a new issue