def dump_belongs_to_associations!
belongs_to_reflections.map do |reflection|
next if to_load_map[reflection.name].empty?
RelationDumper.new(
build_relation(reflection),
root_dumper,
"#{association_path}.#{reflection.name}",
search_key: reflection.association_primary_key,
identifiers: to_load_map[reflection.name],
limitable: false,
).call
end
end
From
RelationDumper- to me it seems like this is recursive, which might cause some resource issues in a larger DB with a lot of relationships.