Move errors from email to new_email properly
This commit is contained in:
parent
dcf3416669
commit
3be14c2a05
1 changed files with 3 additions and 2 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue