simplifies erase action
This commit is contained in:
@@ -15,15 +15,9 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def delete
|
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])
|
current_user.erase(erase_params[:erase_reason])
|
||||||
|
sign_out
|
||||||
yield resource if block_given?
|
redirect_to root_url, notice: t("devise.registrations.destroyed")
|
||||||
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) }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def success
|
def success
|
||||||
|
|||||||
Reference in New Issue
Block a user