summaryrefslogtreecommitdiff
path: root/app/services/application_settings/update_service.rb
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-09-07 14:32:28 +0000
committerDouwe Maan <douwe@gitlab.com>2018-09-07 14:32:28 +0000
commita415a904b8b03543dfdfab4667336b603b45eb28 (patch)
tree7cca179d7f884fc54afeccb2285469dbbcef3a53 /app/services/application_settings/update_service.rb
parent1f765ce9ea25b45cd702c25ccb762eacceb9a4ae (diff)
downloadgitlab-ce-a415a904b8b03543dfdfab4667336b603b45eb28.tar.gz
Ask user explicitly about usage stats agreement
Diffstat (limited to 'app/services/application_settings/update_service.rb')
-rw-r--r--app/services/application_settings/update_service.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb
index 19cf34e2ac4..2e4643ed668 100644
--- a/app/services/application_settings/update_service.rb
+++ b/app/services/application_settings/update_service.rb
@@ -11,11 +11,19 @@ module ApplicationSettings
params[:performance_bar_allowed_group_id] = performance_bar_allowed_group_id
end
+ if usage_stats_updated? && !params.delete(:skip_usage_stats_user)
+ params[:usage_stats_set_by_user_id] = current_user.id
+ end
+
@application_setting.update(@params)
end
private
+ def usage_stats_updated?
+ params.key?(:usage_ping_enabled) || params.key?(:version_check_enabled)
+ end
+
def update_terms(terms)
return unless terms.present?