提交 bc77ccac 编写于 作者: A Aaron Patterson

split up construction and mutation

上级 7f55ef8c
...@@ -14,7 +14,10 @@ def source_reflection ...@@ -14,7 +14,10 @@ def source_reflection
def associated_records_by_owner def associated_records_by_owner
through_records = through_records_by_owner through_records = through_records_by_owner
Preloader.new(through_records.values.flatten, source_reflection.name, reflection_scope).run preloader = Preloader.new(through_records.values.flatten,
source_reflection.name,
reflection_scope)
preloader.run
through_records.each do |owner, records| through_records.each do |owner, records|
records.map! { |r| r.send(source_reflection.name) }.flatten! records.map! { |r| r.send(source_reflection.name) }.flatten!
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册