refactor(activation): more readable condition
This commit is contained in:
parent
845a4582d3
commit
d29cf3d222
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ class Users::ActivateController < ApplicationController
|
|||
user = User.find_by(confirmation_token: params[:token])
|
||||
if user && user.email_verified_at
|
||||
flash[:notice] = "Votre email est déjà vérifié"
|
||||
elsif user && 2.days.ago < user.confirmation_sent_at
|
||||
elsif user && user.confirmation_sent_at >= 2.days.ago
|
||||
user.update!(email_verified_at: Time.zone.now)
|
||||
flash[:notice] = 'Votre email a bien été vérifié'
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue