diff options
author | masarakki <masaki182@gmail.com> | 2017-06-19 22:12:31 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-19 15:12:31 +0200 |
commit | ff142eb64d2d1251f9df1baa0b302fd532ec30ed (patch) | |
tree | 66c9e30ddef330ae32d3b0adb75983bf38bc0a4b /app/controllers/settings | |
parent | 500e28442f8e6657de766fbdb4a4cfdb164b2b92 (diff) |
setting-for-account-deletable (#3852)
Diffstat (limited to 'app/controllers/settings')
-rw-r--r-- | app/controllers/settings/deletes_controller.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/settings/deletes_controller.rb b/app/controllers/settings/deletes_controller.rb index dd18b4c2f..80002b995 100644 --- a/app/controllers/settings/deletes_controller.rb +++ b/app/controllers/settings/deletes_controller.rb @@ -3,6 +3,7 @@ class Settings::DeletesController < ApplicationController layout 'admin' + before_action :check_enabled_deletion before_action :authenticate_user! def show @@ -21,6 +22,10 @@ class Settings::DeletesController < ApplicationController private + def check_enabled_deletion + redirect_to root_path unless Setting.open_deletion + end + def delete_params params.require(:form_delete_confirmation).permit(:password) end |