From 18b3ac641b78717560a670417b97645563ff44f7 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Nov 2022 14:26:03 +0100 Subject: [PATCH] Add user requirement setting to privacy settings --- app/controllers/settings/privacy_controller.rb | 3 ++- app/views/settings/privacy/edit.html.haml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/settings/privacy_controller.rb b/app/controllers/settings/privacy_controller.rb index f85201f1..038cba98 100644 --- a/app/controllers/settings/privacy_controller.rb +++ b/app/controllers/settings/privacy_controller.rb @@ -9,7 +9,8 @@ class Settings::PrivacyController < ApplicationController user_attributes = params.require(:user).permit(:privacy_allow_anonymous_questions, :privacy_allow_public_timeline, :privacy_allow_stranger_answers, - :privacy_show_in_search) + :privacy_show_in_search, + :privacy_require_user) if current_user.update(user_attributes) flash[:success] = t(".success") else diff --git a/app/views/settings/privacy/edit.html.haml b/app/views/settings/privacy/edit.html.haml index e2287aad..3a3f6168 100644 --- a/app/views/settings/privacy/edit.html.haml +++ b/app/views/settings/privacy/edit.html.haml @@ -2,6 +2,7 @@ .card-body = bootstrap_form_for(current_user, url: settings_privacy_path, method: :patch, data: { turbo: false }) do |f| = f.check_box :privacy_allow_anonymous_questions + = f.check_box :privacy_require_user = f.check_box :privacy_allow_public_timeline = f.check_box :privacy_allow_stranger_answers