提交 fc2d79b6 编写于 作者: Y Yves Senn

Merge pull request #11730 from neerajdotname/use_flat_map

use flat_map
......@@ -77,7 +77,7 @@ def associated_records_by_owner
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册