提交 931a6aba 编写于 作者: A Aaron Patterson

lhs preload is always a single preload, so just preload one

上级 a04965b4
......@@ -112,10 +112,10 @@ def preload(association)
end
def preload_hash(association)
association.each do |parent, child|
Preloader.new(records, parent, preload_scope).run
association.flat_map { |parent, child|
preload_one parent
Preloader.new(records.map { |record| record.send(parent) }.flatten, child).run
end
}
end
# Not all records have the same class, so group then preload group on the reflection
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册