* Wip: マイグレーション、設定など一式 * Fix test * Fix test * Fix: マスター用の設定を他サーバーに送信しないよう修正 * DTL、外部サーバーの情報受け入れのテストを追加 * スペルミスを修正 * Web画面に設定項目追加 * 既存の`master_settings`を上書きしないよう修正
27 lines
703 B
Ruby
27 lines
703 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Settings::PrivacyExtraController < Settings::BaseController
|
|
before_action :set_account
|
|
|
|
def show; end
|
|
|
|
def update
|
|
if UpdateAccountService.new.call(@account, account_params.except(:settings))
|
|
current_user.update!(settings_attributes: account_params[:settings])
|
|
ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
|
|
redirect_to settings_privacy_extra_path, notice: I18n.t('generic.changes_saved_msg')
|
|
else
|
|
render :show
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def account_params
|
|
params.require(:account).permit(:subscription_policy, settings: UserSettings.keys)
|
|
end
|
|
|
|
def set_account
|
|
@account = current_account
|
|
end
|
|
end
|