bullet
bullet copied to clipboard
Does Bullet work with Rails Engine?
Recently been working on an engine and then when we integrate it with the host app it turns out that there are some uncaught N+1 queries coming from engine, so just wondering if Bullet works with rails engine?
I just did a quick test but doesn't seem to be working, so just wondering if I'm doing something wrong.
These are what I've done:
- add
bullet
asadd_development_dependency
in.gemspec
- enable
Bullet
inafter_initialization
in bothdevelopment.rb
andtest.rb
- start
Bullet.start_request
inspec_helper
as per README
Do advise!
@flyerhzm hey just wondering if there's anything I can help to debug?
A lot of our services are wrapped in engines as well. We have bullet set to raise on n+1's but nothing has been raised and no logs written. Something about this cannot be correct because our codebase is actually full of them.
If it's related to your issue then it does seem to be a problem.
Is it only N+1 warnings that you're not seeing reported from engines, or are you also missing warnings to use/avoid eager loading? ShinyCMS is made almost entirely out of multiple Rails engines (in a single codebase), and bullet seems to be finding plenty of eager loading stuff... but no N+1 warnings (or counter cache).
ETA: Oops, just saw how old this thread is; sorry! I'll try to trigger some N+1 warnings deliberately and give a definite yes/no on whether they show up, maybe this can be closed if I can't provoke any.