Skip to content

Commit

Permalink
Fixed graph on many to manu relations
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Naiman committed Mar 8, 2021
1 parent 7c96610 commit 55570ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rasti/db/relations/many_to_many.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def fetch_graph(environment, rows, selected_attributes=nil, excluded_attributes=
relations_graph.fetch_graph join_rows if relations_graph

relation_rows = join_rows.each_with_object(Hash.new { |h,k| h[k] = [] }) do |row, hash|
attributes = row.select { |attr,_| target_collection_class.collection_attributes.include? attr }
attributes = row.select { |attr,_| target_collection_class.model.attribute_names.include? attr }
hash[row[:source_foreign_key]] << target_collection_class.model.new(attributes)
end

Expand Down

0 comments on commit 55570ff

Please sign in to comment.