summaryrefslogtreecommitdiff
path: root/users/app/controllers
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-11-06 11:55:43 +0100
committerAzul <azul@leap.se>2013-11-06 11:55:43 +0100
commitded302ebc6a9e145775f7847c5e89f91d683c777 (patch)
tree890ea32fbbdfc9ccda2e05bbcce4b32b537b2cea /users/app/controllers
parent24598b5c5e4df20c423ec74ea8e9df1592483c6b (diff)
use the account lifecycle from UsersController#destroy
Diffstat (limited to 'users/app/controllers')
-rw-r--r--users/app/controllers/users_controller.rb2
-rw-r--r--users/app/controllers/v1/users_controller.rb8
2 files changed, 2 insertions, 8 deletions
diff --git a/users/app/controllers/users_controller.rb b/users/app/controllers/users_controller.rb
index de21983..3cbb6dc 100644
--- a/users/app/controllers/users_controller.rb
+++ b/users/app/controllers/users_controller.rb
@@ -47,7 +47,7 @@ class UsersController < UsersBaseController
end
def destroy
- @user.destroy
+ @user.account.destroy
flash[:notice] = I18n.t(:account_destroyed)
# admins can destroy other users
if @user != current_user
diff --git a/users/app/controllers/v1/users_controller.rb b/users/app/controllers/v1/users_controller.rb
index 03a5a62..0903888 100644
--- a/users/app/controllers/v1/users_controller.rb
+++ b/users/app/controllers/v1/users_controller.rb
@@ -24,15 +24,9 @@ module V1
end
def update
- account.update params[:user]
+ @user.account.update params[:user]
respond_with @user
end
- protected
-
- def account
- @user.account
- end
-
end
end