Move errors from email to new_email properly

This commit is contained in:
Tom Hughes 2025-01-01 12:27:05 +00:00
parent dcf3416669
commit 3be14c2a05

View file

@ -59,8 +59,9 @@ module UserMethods
# Ignore errors sending email
end
else
current_user.errors.add(:new_email, current_user.errors[:email])
current_user.errors.add(:email, [])
current_user.errors.delete(:email).each do |error|
current_user.errors.add(:new_email, error)
end
end
user.restore_email!