From d54abb5dfe6f59e1ac09a72fd6fb56d8194aa8a5 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 20 Oct 2015 12:57:12 +0200 Subject: [PATCH] simplifies erase action --- app/controllers/users/registrations_controller.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 736e76b15..a707d7e75 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -15,15 +15,9 @@ class Users::RegistrationsController < Devise::RegistrationsController end def delete - # The only difference between this version of delete and the original are the following two lines - # (we build the resource differently and we also call erase instead of destroy) - resource = current_user current_user.erase(erase_params[:erase_reason]) - - yield resource if block_given? - Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name) - set_flash_message :notice, :destroyed if is_flashing_format? - respond_with_navigational(resource){ redirect_to after_sign_out_path_for(resource_name) } + sign_out + redirect_to root_url, notice: t("devise.registrations.destroyed") end def success