bullet icon indicating copy to clipboard operation
bullet copied to clipboard

Does Bullet work with Rails Engine?

Open edisonywh opened this issue 5 years ago • 3 comments

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 as add_development_dependency in .gemspec
  • enable Bullet in after_initialization in both development.rb and test.rb
  • start Bullet.start_request in spec_helper as per README

Do advise!

edisonywh avatar May 27 '19 09:05 edisonywh

@flyerhzm hey just wondering if there's anything I can help to debug?

edisonywh avatar Jul 24 '19 06:07 edisonywh

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.

choubacha avatar Mar 25 '20 17:03 choubacha

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.

denny avatar Mar 08 '21 14:03 denny