Change: #591 ホワイトリストのドメイン一覧の保存先・画面変更 (#689)

* Change: #591 ホワイトリストのドメイン一覧の保存先・画面変更

* Update account_batch.rb

* 表示まわりを改善

* Update dangerous.rake
This commit is contained in:
KMY(雪あすか) 2024-04-03 12:09:43 +09:00 committed by GitHub
parent 8c399cefce
commit ff2860d0df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 211 additions and 49 deletions

View file

@ -2,10 +2,33 @@
module Admin
class NgWords::WhiteListController < NgWordsController
def show
super
@white_list_domains = SpecifiedDomain.white_list_domain_caches.presence || [SpecifiedDomain.new]
end
protected
def validate
begin
SpecifiedDomain.save_from_raws_as_white_list(settings_params_list)
return true
rescue
flash[:alert] = I18n.t('admin.ng_words.save_error')
redirect_to after_update_redirect_path
end
false
end
def after_update_redirect_path
admin_ng_words_white_list_path
end
private
def settings_params_list
params.require(:form_admin_settings)[:specified_domains]
end
end
end