-
Notifications
You must be signed in to change notification settings - Fork 451
Open
Labels
Description
As other issues note Bullet seems to have eager load false positives in test mode.
So the obvious workaround is to disable the unused eager loading check in test mode like so:
# config/environments/test.rb
# ...
config.after_initialize do
Bullet.enable = true
Bullet.bullet_logger = true
Bullet.raise = true
Bullet.n_plus_one_query_enable = true
Bullet.unused_eager_loading_enable = false
Bullet.counter_cache_enable = false
end
end
This doesn't work! I still get errors. I have cleared tmp/cache
and restarted Spring. The only thing that does work is completely disabling bullet in tests:
# config/environments/test.rb
# ...
config.after_initialize do
Bullet.enable = false
# ...
end
end
All I can think is that Bullet.n_plus_one_query_enable
must be a singleton method and as feature specs run in a separate thread maybe the bullet config is different in the feature server thread?
adsteel, jotolo, aseroff, victorhazbun, Jesterovskiy and 10 more