summaryrefslogtreecommitdiff
path: root/config/initializers/bullet.rb
blob: 2d21514b121fcf9535559dc1ca2200207f81c702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

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