From a415a904b8b03543dfdfab4667336b603b45eb28 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Fri, 7 Sep 2018 14:32:28 +0000 Subject: Ask user explicitly about usage stats agreement --- app/services/application_settings/update_service.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/services/application_settings') 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? -- cgit v1.2.1