2021-02-03 16:09:17 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-05-21 20:08:07 -04:00
|
|
|
def bullet_enabled?
|
|
|
|
Gitlab::Utils.to_boolean(ENV['ENABLE_BULLET'].to_s)
|
|
|
|
end
|
|
|
|
|
|
|
|
if defined?(Bullet) && (bullet_enabled? || Rails.env.development?)
|
2017-03-27 13:28:34 -04:00
|
|
|
Rails.application.configure do
|
|
|
|
config.after_initialize do
|
|
|
|
Bullet.enable = true
|
2015-10-13 05:54:06 -04:00
|
|
|
|
2020-05-21 20:08:07 -04:00
|
|
|
Bullet.bullet_logger = bullet_enabled?
|
|
|
|
Bullet.console = bullet_enabled?
|
|
|
|
|
2017-03-27 13:28:34 -04:00
|
|
|
Bullet.raise = Rails.env.test?
|
|
|
|
end
|
|
|
|
end
|
2015-10-13 05:54:06 -04:00
|
|
|
end
|