Question

I'm using the gem called "bullet" https://github.com/flyerhzm/bullet This help to avoid N + 1 problem.

I'd like to use this in production mode with my account(User.id==1) Is it possible?

I've coded this in /config/environments/production.rb but the alert pops up whoever the users access.

  config.after_initialize do
    Bullet.enable = true 
    Bullet.alert = true 
    Bullet.bullet_logger = true 
    Bullet.console = true 
    Bullet.rails_logger = true 
  end
Was it helpful?

Solution

I dont know, but you should copy the production database to your local host and try it there, if you dont have enough testing data..

Usually its not recommended to run development gems in production.

==

You can show the bullet output only in the bullet log files (this is not related to user on, but to all users in general):

  config.after_initialize do
    Bullet.enable = true 
    Bullet.alert = false 
    Bullet.bullet_logger = true 
    Bullet.console = false 
    Bullet.rails_logger = false 
  end

Afterwards you can watch the output in the bullet.log file

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top