From 21910c959e707e1f285cf8843eb533ca8adfba05 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Mon, 9 Dec 2019 16:50:30 +0100 Subject: [PATCH] @current_user -> current_user --- app/controllers/users/profil_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/users/profil_controller.rb b/app/controllers/users/profil_controller.rb index 13c9c7f20..41cc5b6cf 100644 --- a/app/controllers/users/profil_controller.rb +++ b/app/controllers/users/profil_controller.rb @@ -10,14 +10,14 @@ module Users end def update_email - if @current_user.update(update_email_params) + if current_user.update(update_email_params) flash.notice = t('devise.registrations.update_needs_confirmation') - elsif @current_user.errors&.details&.dig(:email)&.any? { |e| e[:error] == :taken } - UserMailer.account_already_taken(@current_user, requested_email).deliver_later + elsif current_user.errors&.details&.dig(:email)&.any? { |e| e[:error] == :taken } + UserMailer.account_already_taken(current_user, requested_email).deliver_later # avoid leaking information about whether an account with this email exists or not flash.notice = t('devise.registrations.update_needs_confirmation') else - flash.alert = @current_user.errors.full_messages + flash.alert = current_user.errors.full_messages end redirect_to profil_path