From 15d442cf9dcd0ba5958be54c285dfeb32276190e Mon Sep 17 00:00:00 2001 From: Eugen Date: Sun, 9 Apr 2017 20:23:14 +0200 Subject: Fix /api/v1/accounts/update_credentials tests (#1357) --- app/controllers/api/v1/accounts_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'app/controllers/api') diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb index bb7cda035..2c44e36a7 100644 --- a/app/controllers/api/v1/accounts_controller.rb +++ b/app/controllers/api/v1/accounts_controller.rb @@ -17,10 +17,8 @@ class Api::V1::AccountsController < ApiController end def update_credentials - @account = current_user.account - - @account.update_attributes!(account_params) - + current_account.update!(account_params) + @account = current_account render action: :show end @@ -146,6 +144,6 @@ class Api::V1::AccountsController < ApiController end def account_params - @account_params ||= params.permit(:display_name, :note, :avatar, :header) + params.permit(:display_name, :note, :avatar, :header) end end -- cgit