rom-factory
rom-factory copied to clipboard
Allow for option to override association factory name
I have a unique problem where my Repo/Entity is called indie as in an Indie artist. The infer_factory_name(name)
method https://github.com/rom-rb/rom-factory/blob/v0.6.0/lib/rom/factory/factories.rb#L203 tries looking for the Indy factory which does not exist.
You are not alone. I'm having same issue in v0.9.0
Please provide a reproduction script
+1 Have same problem Simple workaround - create alias from required factory:
FactoryBot.define(:store_products) do |f|
f.title { fake(:device, :model_name) }
f.description { fake(:lorem, :paragraph) }
f.timestamps
end
FactoryBot.define(store_product: :store_products) do |f|
end
FactoryBot.define(:store_product_prices) do |f|
f.description { fake(:lorem, :paragraph) }
f.association(:product)
f.timestamps
end