Method: ROM::Factory::TupleEvaluator#build_assoc_attrs

Defined in:
lib/rom/factory/tuple_evaluator.rb

#build_assoc_attrs(key, fk, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



100
101
102
103
104
105
106
# File 'lib/rom/factory/tuple_evaluator.rb', line 100

def build_assoc_attrs(key, fk, value)
  if value.is_a?(Array)
    value.map { |el| build_assoc_attrs(key, fk, el) }
  else
    {attributes[key].foreign_key => fk}.merge(value.to_h)
  end
end