Replace deprecated ActiveModel::Errors get/set methods
authorTom Hughes <tom@compton.nu>
Mon, 5 Jun 2017 21:31:13 +0000 (22:31 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 5 Jun 2017 21:41:23 +0000 (22:41 +0100)
app/controllers/user_controller.rb

index 6b50798313db59b7196e8466348bc99ae07f562d..b6fc79b25151db50f9f935699b21c7efc6d839c9 100644 (file)
@@ -725,8 +725,8 @@ class UserController < ApplicationController
             # Ignore errors sending email
           end
         else
-          @user.errors.set(:new_email, @user.errors.get(:email))
-          @user.errors.set(:email, [])
+          @user.errors.add(:new_email, @user.errors[:email])
+          @user.errors.add(:email, [])
         end
 
         user.restore_email!