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

Change from on_load :active_record to on_load :after_initialize to ensure the Rails configuration is available #435

Closed
wants to merge 1 commit into from

Conversation

TylerRick
Copy link

Otherwise one can run into this error:

  gems/railties-7.1.2/lib/rails.rb:51:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)

      application.config
                 ^^^^^^^
  from gems/factory_bot_rails-6.4.0/lib/factory_bot_rails/railtie.rb:28:in `block in <class:Railtie>'

…o ensure the Rails

configuration is available.

Otherwise one can run into this error:
  gems/railties-7.1.2/lib/rails.rb:51:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)

      application.config
                 ^^^^^^^
  from gems/factory_bot_rails-6.4.0/lib/factory_bot_rails/railtie.rb:28:in `block in <class:Railtie>'
@TylerRick
Copy link
Author

Oops, I created this before I'd seen #433.

Looks like #432 (initializer) would be a better solution. Closing...

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

Successfully merging this pull request may close these issues.

1 participant