Module: ServicePing::ServicePingSettings

Extended by:
ServicePingSettings
Included in:
ServicePingSettings
Defined in:
lib/service_ping/service_ping_settings.rb

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

If it is EE and license operational metric is true, then we will show enable service ping checkbox checked, as it will always send service ping

Returns:

  • (Boolean)


18
19
20
# File 'lib/service_ping/service_ping_settings.rb', line 18

def enabled?
  license_operational_metric_enabled? || ::Gitlab::CurrentSettings.usage_ping_enabled?
end

#enabled_and_consented?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/service_ping/service_ping_settings.rb', line 7

def enabled_and_consented?
  enabled? && !User.single_user&.requires_usage_stats_consent?
end

#license_operational_metric_enabled?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/service_ping/service_ping_settings.rb', line 11

def license_operational_metric_enabled?
  false
end