From e9bdd2aa5a0662a9fc6d5ce730e26cfd560210ba Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 3 Apr 2017 10:43:42 +0200 Subject: feature: delete user clearing username --- app/controllers/users_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/controllers/users_controller.rb') diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0a0f551..da82d1c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -44,7 +44,7 @@ class UsersController < ApplicationController end def destroy - @user.account.destroy + @user.account.destroy(release_handles) flash[:notice] = I18n.t(:account_destroyed) # admins can destroy other users if @user != current_user @@ -65,4 +65,8 @@ class UsersController < ApplicationController params.require(:user).permit(:password, :password_confirmation) end end + + def release_handles + ! params[:block_username] + end end -- cgit v1.2.3