Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for option to override association factory name #37

Open
cmavromoustakos opened this issue Dec 14, 2018 · 3 comments
Open

Allow for option to override association factory name #37

cmavromoustakos opened this issue Dec 14, 2018 · 3 comments
Labels

Comments

@cmavromoustakos
Copy link

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.

@graudeejs
Copy link

You are not alone. I'm having same issue in v0.9.0

@solnic
Copy link
Member

solnic commented Sep 1, 2019

Please provide a reproduction script

@solnic solnic added the bug label Sep 1, 2019
@izikaj
Copy link

izikaj commented Oct 8, 2019

+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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants