mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-20 14:11:11 +00:00

Use the EnforcedStyleForMultiline: no_comma option. Signed-off-by: Rémy Coutable <remy@rymai.me>
28 lines
529 B
Ruby
28 lines
529 B
Ruby
module Gitlab
|
|
module Sentry
|
|
def self.enabled?
|
|
Rails.env.production? && current_application_settings.sentry_enabled?
|
|
end
|
|
|
|
def self.context(current_user = nil)
|
|
return unless self.enabled?
|
|
|
|
if current_user
|
|
Raven.user_context(
|
|
id: current_user.id,
|
|
email: current_user.email,
|
|
username: current_user.username
|
|
)
|
|
end
|
|
end
|
|
|
|
def self.program_context
|
|
if Sidekiq.server?
|
|
'sidekiq'
|
|
else
|
|
'rails'
|
|
end
|
|
end
|
|
end
|
|
end
|