summaryrefslogtreecommitdiff
path: root/config/initializers/bullet.rb
blob: d1f72ca3ce74b3de4c7d028c59f68bd02e727ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def bullet_enabled?
  Gitlab::Utils.to_boolean(ENV['ENABLE_BULLET'].to_s)
end

if defined?(Bullet) && (bullet_enabled? || Rails.env.development?)
  Rails.application.configure do
    config.after_initialize do
      Bullet.enable = true

      Bullet.bullet_logger = bullet_enabled?
      Bullet.console = bullet_enabled?

      Bullet.raise = Rails.env.test?
    end
  end
end