Fixes implementation bug when erasing account

This commit is contained in:
kikito
2015-10-19 20:14:09 +02:00
parent 9267948a99
commit f7f0dc17dd

View File

@@ -17,8 +17,8 @@ class Users::RegistrationsController < Devise::RegistrationsController
def delete def delete
# The only difference between this version of delete and the original are the following two lines # 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) # (we build the resource differently and we also call erase instead of destroy)
build_resource(erase_params) resource = current_user
resource.erase(params[:erase_reason]) current_user.erase(erase_params[:erase_reason])
yield resource if block_given? yield resource if block_given?
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name) Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)