lib/rom/sql/plugin/associates.rb in rom-sql-2.0.0 vs lib/rom/sql/plugin/associates.rb in rom-sql-2.1.0
- old
+ new
@@ -119,12 +119,12 @@
pk, fk = assoc.parent_combine_keys
case parent
when Array
- parent.map do |p|
+ parent.flat_map do |p|
tuples.map { |tuple| Hash(tuple).merge(fk => p[pk]) }
- end.flatten(1)
+ end
else
tuples.map { |tuple| Hash(tuple).update(fk => parent[pk]) }
end
else
with_input_tuples(tuples).map { |tuple|