Open zoras opened 6 years ago
Hey Zoras, did you manage to solve the issue? I have a pretty similar one.
Nop, I've skipped the bullet warnings by whitelisting https://github.com/flyerhzm/bullet#whitelist
# application_controller.rb
def skip_bullet
Bullet.enable = false if %w(development test).include?(Rails.env)
yield
ensure
Bullet.enable = true if %w(development test).include?(Rails.env)
end
# some_controller.rb
around_action :skip_bullet, only: :action
Thanks 👍
Same issue here using accepts_nested_attributes_for
Is there any alternative than skipping this case?
I'm experiencing the same issue, I have nested attributes which raises an N+1 error, though in my case the relationship is one to many and the warning comes from a many to one association on the nested model being updated.
Same.
Instead of disabling Bullet warnings in full you can use this instead to just disable USE eager loading detected
:
Bullet.n_plus_one_query_enable = false
// do stuff in test
Bullet.n_plus_one_query_enable = true
Number of times I've come here into this issue and surprised myself seeing my reply from years ago: 3
Given above conditions saving event with nested user and profile params raises bullet error
Event.includes(user: :profile).save(event_params)
I doubt this is a false positive or something can be done?