summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2017-03-27 13:28:34 -0400
committerRobert Speicher <rspeicher@gmail.com>2017-04-03 17:15:09 -0400
commitf61ded8214f47870ed9a644fe83bd9978aa3afa6 (patch)
tree2127680f1c788108933cb24a6309ba8347899180
parentc2b35320e05c5e0cb3bdc11fa1418ed5f3e5c76f (diff)
downloadgitlab-ce-f61ded8214f47870ed9a644fe83bd9978aa3afa6.tar.gz
Enable the `bullet_logger` setting; enable `raise` in test environmentrs-bullet-raise
-rw-r--r--Gemfile2
-rw-r--r--config/initializers/bullet.rb13
2 files changed, 10 insertions, 5 deletions
diff --git a/Gemfile b/Gemfile
index 0c6bb805b98..910ab318227 100644
--- a/Gemfile
+++ b/Gemfile
@@ -260,7 +260,6 @@ group :development do
gem 'brakeman', '~> 3.6.0', require: false
gem 'letter_opener_web', '~> 1.3.0'
- gem 'bullet', '~> 5.5.0', require: false
gem 'rblineprof', '~> 0.3.6', platform: :mri, require: false
# Better errors handler
@@ -272,6 +271,7 @@ group :development do
end
group :development, :test do
+ gem 'bullet', '~> 5.5.0', require: !!ENV['ENABLE_BULLET']
gem 'pry-byebug', '~> 3.4.1', platform: :mri
gem 'pry-rails', '~> 0.3.4'
diff --git a/config/initializers/bullet.rb b/config/initializers/bullet.rb
index 95e82966c7a..0ade7109420 100644
--- a/config/initializers/bullet.rb
+++ b/config/initializers/bullet.rb
@@ -1,6 +1,11 @@
-if ENV['ENABLE_BULLET']
- require 'bullet'
+if defined?(Bullet) && ENV['ENABLE_BULLET']
+ Rails.application.configure do
+ config.after_initialize do
+ Bullet.enable = true
- Bullet.enable = true
- Bullet.console = true
+ Bullet.bullet_logger = true
+ Bullet.console = true
+ Bullet.raise = Rails.env.test?
+ end
+ end
end