Skip to content

Commit 3be14c2

Browse files
committed
Move errors from email to new_email properly
1 parent dcf3416 commit 3be14c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/controllers/concerns/user_methods.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ def update_user(user, params)
5959
# Ignore errors sending email
6060
end
6161
else
62-
current_user.errors.add(:new_email, current_user.errors[:email])
63-
current_user.errors.add(:email, [])
62+
current_user.errors.delete(:email).each do |error|
63+
current_user.errors.add(:new_email, error)
64+
end
6465
end
6566

6667
user.restore_email!

0 commit comments

Comments
 (0)