mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use flat_map
This commit is contained in:
parent
71f512646a
commit
1d0a306b57
1 changed files with 1 additions and 1 deletions
|
@ -77,7 +77,7 @@ module ActiveRecord
|
|||
# Some databases impose a limit on the number of ids in a list (in Oracle it's 1000)
|
||||
# Make several smaller queries if necessary or make one query if the adapter supports it
|
||||
sliced = owner_keys.each_slice(klass.connection.in_clause_length || owner_keys.size)
|
||||
records = sliced.map { |slice| records_for(slice).to_a }.flatten
|
||||
records = sliced.flat_map { |slice| records_for(slice).to_a }
|
||||
end
|
||||
|
||||
# Each record may have multiple owners, and vice-versa
|
||||
|
|
Loading…
Reference in a new issue