With the addition of ROM::Factory::UnknownFactoryAttributes, it has become apparent that attributes provided to structs are being passed into associations. This PR fixes the issue for ManyToOne associations. Here's an example:
factories.define(:task) do |f|
f.title { 'Foo' }
f.association(:user)
end
factories.define(:user) do |f|
f.timestamps
end
Currently, attributes provided to the task struct are being passed into the user association:
With the addition of
ROM::Factory::UnknownFactoryAttributes
, it has become apparent that attributes provided to structs are being passed into associations. This PR fixes the issue forManyToOne
associations. Here's an example:Currently, attributes provided to the
task
struct are being passed into theuser
association:This PR makes it possible to build such structs without exceptions: