about summary refs log tree commit diff
path: root/app/controllers
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-09 20:23:14 +0200
committerGitHub <noreply@github.com>2017-04-09 20:23:14 +0200
commit15d442cf9dcd0ba5958be54c285dfeb32276190e (patch)
treedc1f60cc77ba70f61614c75224c0c3f1e7fdf7ab /app/controllers
parent43f955e31f6e174428de01c6fe6f518836e64ead (diff)
Fix /api/v1/accounts/update_credentials tests (#1357)
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api/v1/accounts_controller.rb8
1 files changed, 3 insertions, 5 deletions
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