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

FactoryBot linter failing for a model that uses closure_tree #308

Closed
bijalhopkins opened this issue May 2, 2018 · 3 comments
Closed

FactoryBot linter failing for a model that uses closure_tree #308

bijalhopkins opened this issue May 2, 2018 · 3 comments

Comments

@bijalhopkins
Copy link

I have a model that I am using closure tree with and have a factory created for it. We have a spec that does FactoryBot.lint FactoryBot.factories, which is now failing because of the error below.

expected no Exception, got #<FactoryBot::InvalidFactoryError: The following factories are invalid:

* display_logic - undefined local variable or method `_ct_reorder_prior_siblings_if_parent_changed' for #<Registries::DisplayLogic:0x00007ffb3bc1c828> (NameError)

This was the last commit where the factory was passing the linter. Any suggestions on how to fix this?

rails (5.2.0)
factory_bot (4.8.2)
factory_bot_rails (4.8.2)

@chunlea
Copy link

chunlea commented May 10, 2018

We met the same problem in production after using the code in master branch. Any update?

@bijalhopkins
Copy link
Author

@chunlea I digged into it and found out it was this change that broke it. I am still trying to figure out why ActiveRecord is not connected in my test environment.

@n-rodriguez
Copy link
Contributor

I am still trying to figure out why ActiveRecord is not connected in my test environment.

See #264 :

Rails itself (without closure_tree) doesn't hit the DB until first request will come, so everything works as expected even if DB was not ready at time of first request (ActiveRecord will analyze tables when DB will be ready).

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

No branches or pull requests

3 participants