diff --git a/app/controllers/devise_token_auth/passwords_controller.rb b/app/controllers/devise_token_auth/passwords_controller.rb index 45f331136..2c3e59516 100644 --- a/app/controllers/devise_token_auth/passwords_controller.rb +++ b/app/controllers/devise_token_auth/passwords_controller.rb @@ -92,7 +92,7 @@ def update def resource_update_method allow_password_change = recoverable_enabled? && @resource.allow_password_change == true if DeviseTokenAuth.check_current_password_before_update == false || allow_password_change - 'update_attributes' + 'update' else 'update_with_password' end diff --git a/app/controllers/devise_token_auth/registrations_controller.rb b/app/controllers/devise_token_auth/registrations_controller.rb index e2d7f08b4..f08b651f7 100644 --- a/app/controllers/devise_token_auth/registrations_controller.rb +++ b/app/controllers/devise_token_auth/registrations_controller.rb @@ -181,7 +181,7 @@ def resource_update_method elsif account_update_params.key?(:current_password) 'update_with_password' else - 'update_attributes' + 'update' end end diff --git a/test/controllers/demo_user_controller_test.rb b/test/controllers/demo_user_controller_test.rb index b4aea3518..9f301ae99 100644 --- a/test/controllers/demo_user_controller_test.rb +++ b/test/controllers/demo_user_controller_test.rb @@ -321,8 +321,8 @@ class DemoUserControllerTest < ActionDispatch::IntegrationTest assert @resource.tokens.count > 1 # password changed from new device - @resource.update_attributes(password: 'newsecret123', - password_confirmation: 'newsecret123') + @resource.update(password: 'newsecret123', + password_confirmation: 'newsecret123') get '/demo/members_only', params: {}, diff --git a/test/dummy/app/controllers/overrides/registrations_controller.rb b/test/dummy/app/controllers/overrides/registrations_controller.rb index 1dd67bbb4..184d7890c 100644 --- a/test/dummy/app/controllers/overrides/registrations_controller.rb +++ b/test/dummy/app/controllers/overrides/registrations_controller.rb @@ -6,7 +6,7 @@ class RegistrationsController < DeviseTokenAuth::RegistrationsController def update if @resource - if @resource.update_attributes(account_update_params) + if @resource.update(account_update_params) render json: { status: 'success', data: @resource.as_json,