0

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
4

1 回答 1

1

我不知道,但是如果您没有足够的测试数据,您应该将生产数据库复制到本地主机并在那里尝试。

通常不建议在生产中运行开发 gem。

==

您只能在项目符号日志文件中显示项目符号输出(这与用户无关,但通常与所有用户有关):

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

之后您可以在 bullet.log 文件中查看输出

于 2013-07-17T10:08:49.687 回答