Adds bullet to dev & test, but makes it visible only on-demmand
The logs are always stored in log/bullet.log If you run the specs with `BULLET=true bin/rspec`: * Any feature test which makes bullet angry will fail If you run rails with `BULLET=true bin/rails s`: * It will print the bullet logs in both the rails log and the bullet log * It will show a footer on each page with the N+1 queries etc.
This commit is contained in:
@@ -44,4 +44,13 @@ Rails.application.configure do
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
|
||||
config.cache_store = :null_store
|
||||
|
||||
config.after_initialize do
|
||||
Bullet.enable = true
|
||||
Bullet.bullet_logger = true
|
||||
if ENV['BULLET']
|
||||
Bullet.rails_logger = true
|
||||
Bullet.add_footer = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,4 +45,13 @@ Rails.application.configure do
|
||||
# config.action_view.raise_on_missing_translations = true
|
||||
|
||||
config.cache_store = :null_store
|
||||
|
||||
config.after_initialize do
|
||||
Bullet.enable = true
|
||||
Bullet.bullet_logger = true
|
||||
if ENV['BULLET']
|
||||
Bullet.raise = true # raise an error if n+1 query occurs
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user