-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
undefined method `config' for nil:NilClass after upgrading to 6.4.0 #433
Comments
#432 might solve the issue! |
Also experiencing this on 6.4.0 with Rails 7.1.2 and Ruby 3.1.4 |
Superseeds #426 |
Alternative to [thoughtbot/factory_bot#1586][] Depends on [thoughtbot/factory_bot#1587][] First, introduce the `FactoryBotRails::FactoryValidator` class to serve as a generic `factory_bot.compile_factory` event observer. Throughout the lifecycle of the `FactoryBotRails::Railtie`, afford various initializers with opportunities to add purpose-built validators to the instance's internal set. When `factory_bot.compile_factory` events are published, iterate through the list of validators and forward along the value of the [event.payload][] to the validator's `#validate!` method. Next, introduce the Active Record-specific `FactoryBotRails::FactoryValidator::ActiveRecordValidator` class. Only require the module whenever [Active Record's engine is loaded][on_load]. The `ActiveRecordValidator#validate!` method rejects attributes that define primary key generation logic for `ActiveRecord::Base` descendants. In order to test this behavior, add a development dependency on `sqlite3` and `activerecord`, along with some model and database table generating helper methods. [thoughtbot/factory_bot#1586]: thoughtbot/factory_bot#1586 [thoughtbot/factory_bot#1587]: thoughtbot/factory_bot#1587 [event.payload]: module-ActiveSupport::Notifications-label-Subscribers [on_load]: https://guides.rubyonrails.org/engines.html#avoid-loading-rails-frameworks
Until thoughtbot/factory_bot_rails#433 is resolved
Until thoughtbot/factory_bot_rails#433 is resolved
Until thoughtbot/factory_bot_rails#433 is resolved
Until thoughtbot/factory_bot_rails#433 is resolved
Until thoughtbot/factory_bot_rails#433 is resolved
The latest version of factory_bot_rails crashes the app on initialization. I'll remove the restriction once the issue is fixed. thoughtbot/factory_bot_rails#433 I also updated to the latest version some gems that don't seem to be picked up by dependabot.
There's a bug in the latest version of `factory_bot_rails`: thoughtbot/factory_bot_rails#433 There's also a fix that hasn't been merged or released yet: thoughtbot/factory_bot_rails#432 I'm setting the `Gemfile` to specifically avoid those buggy versions so that we can get `depfu` un-blocked with keeping gems up to date.
* Avoid buggy versions of factory_bot_rails There's a bug in the latest version of `factory_bot_rails`: thoughtbot/factory_bot_rails#433 There's also a fix that hasn't been merged or released yet: thoughtbot/factory_bot_rails#432 I'm setting the `Gemfile` to specifically avoid those buggy versions so that we can get `depfu` un-blocked with keeping gems up to date. * dang linter
Also experiencing this on 6.4.0 with Rails 7.0.8 and Ruby 3.2.2. Workaround is to specify it with |
The work around just make it fail later on the factory internals 🤔 here to be precise factory_bot_rails/lib/factory_bot_rails/factory_validator/active_record_validator.rb Line 7 in 3346305
|
should have been tracked down and fixed in #431 |
Make sure you updated |
I'm still getting the |
Even experiencing this on 6.3.0 with rails 7.0.x |
@jarl-dk You have to revert to 6.2.0 for things to work again. |
I'm also still having the issue. 6.4.2 did not fix it for me. The highest working version for me is: |
I can confirm that 6.4.2 has fixed the issue for me that I was seeing in 6.4.0. |
Closing this, as |
Gemfile: I should prob upgrade past 6.4.0 (like said above) and investigate further. |
@Conturbo the issue got fixed, there's nothing to investigate |
Seems to be related to thoughtbot/factory_bot_rails#433 but it only triggered after using flipper
Seems to be related to thoughtbot/factory_bot_rails#433 but it only triggered after using flipper
Description
After the update to 6.4, when starting my rails app I get:
/home/maraud/.rvm/gems/ruby-3.0.4/gems/railties-7.0.4/lib/rails.rb:47:in
configuration': undefined methodconfig' for nil:NilClass (NoMethodError)
Downgrade to 6.2.X solve the issue
Reproduction Steps
Upgrade factory bot rails to 6.4.0
Try to launch puma
Expected behavior
The rails app should be able to initailize or steps on how to make it work with 6.4 should be provided
Actual behavior
/home/maraud/.rvm/gems/ruby-3.0.4/gems/railties-7.0.4/lib/rails.rb:47:in
configuration': undefined methodconfig' for nil:NilClass (NoMethodError)
System configuration
factory_bot_rails version: 6.4.0
factory_bot version: 6.4.0
rails version: 7.0.4
ruby version: 3.0.4
The text was updated successfully, but these errors were encountered: