debian-mirror-gitlab/app/helpers/tracking_helper.rb
2021-04-29 21:17:54 +05:30

23 lines
395 B
Ruby

# frozen_string_literal: true
module TrackingHelper
def tracking_attrs(label, action, property)
return {} unless tracking_enabled?
{
data: {
track_label: label,
track_action: action,
track_property: property
}
}
end
private
def tracking_enabled?
Rails.env.production? &&
::Gitlab::CurrentSettings.snowplow_enabled?
end
end