-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
The railtie included in #419 breaks compatibility with some gems "undefined method `config' for nil:NilClass" Factory Bot > 6.2.0 #426
Comments
Extend ActiveRecord::Base functionality only after ActiveRecord has been fully loaded. Ref: thoughtbot/factory_bot_rails#426
Extend ActiveRecord::Base functionality only after ActiveRecord has been fully loaded. Ref: thoughtbot/factory_bot_rails#426
Extend ActiveRecord::Base functionality only after ActiveRecord has been fully loaded. Ref: thoughtbot/factory_bot_rails#426
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Ref: thoughtbot/factory_bot_rails#426 Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Also: - Require Railtie as suggested by APIs - Patch DBConsole only if needed - Move application configuration check in an after initialize lazy load hook to be sure that `Rails.application` is available at the moment of the check Ref: - thoughtbot/factory_bot_rails#426 - https://edgeapi.rubyonrails.org/classes/Rails/Railtie.html#class-Rails::Railtie-label-Creating+a+Railtie Close #231
Extend `ActiveRecord::Base` functionality only after `ActiveRecord` has been fully loaded. Also: - Require Railtie as suggested by APIs - Patch DBConsole only if needed - Move application configuration check in an after initialize lazy load hook to be sure that `Rails.application` is available at the moment of the check Ref: - thoughtbot/factory_bot_rails#426 - https://edgeapi.rubyonrails.org/classes/Rails/Railtie.html#class-Rails::Railtie-label-Creating+a+Railtie Close #231
Reopen because of #432 |
Closing again in favour of #433 |
I'm having the same issue, which thanks to this thread, I was able to isolate down to the I tried forking this gem and making the prescribed change (makandra/consul@04aa667) Unfortunately, even using this forked version of the gem, I'm getting the same error for anything greater than version 6.2 of the factorbot rails gem. Is there something else I'm missing? Thank you |
Maybe this is related to #432 |
Thanks @tagliala , this merge request fixes the issue. Until this gets merged, I'll just use a forked copy of factorybot_rails with this change applied. |
Hello,
I was testing the main branch and the application didn't boot because of this error:
I think that this is not an issue with Factory Bot Rails, but it is a problem with third-party gems or implementations that does not rely on lazy hooks or autoload to add new modules to
ActiveRecord::Base.
I opened this here because updating factory bot triggers this behavior and may affect other users that may search here for a solution
Reproduction Steps
Gemfile
(or callActiveRecord::Base
before the module block ofconfig/application.rb
)rails c
Expected behavior
Console opens
Actual behavior
Console does not open and raises an error
System configuration
factory_bot_rails version: main
factory_bot version: 6.3.0
rails version: 7.0.8
ruby version: 3.2.2/3.0.4
Bisected to: b965bb8
Affected gems
The text was updated successfully, but these errors were encountered: