diff options
author | jessib <jessib@riseup.net> | 2013-08-27 12:18:35 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-08-27 12:18:35 -0700 |
commit | dc41ae0a3fb0a137e716d8ec63084b0ec3a7299b (patch) | |
tree | c09fef161f105e7c03c35d1edcb2d257144cb97d /users/app/controllers/v1 | |
parent | a87c750d1f12f15272beb117f8ee12ab711cc6d1 (diff) | |
parent | e481b8cbc05a858674a59ef36d695973622f6b3a (diff) |
Merge branch 'master' into billing_with_tests
Diffstat (limited to 'users/app/controllers/v1')
-rw-r--r-- | users/app/controllers/v1/sessions_controller.rb | 2 | ||||
-rw-r--r-- | users/app/controllers/v1/users_controller.rb | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/users/app/controllers/v1/sessions_controller.rb b/users/app/controllers/v1/sessions_controller.rb index 295c327..1b20a82 100644 --- a/users/app/controllers/v1/sessions_controller.rb +++ b/users/app/controllers/v1/sessions_controller.rb @@ -29,7 +29,7 @@ module V1 def destroy logout - redirect_to root_path + head :no_content end protected diff --git a/users/app/controllers/v1/users_controller.rb b/users/app/controllers/v1/users_controller.rb index fda56f2..f380c19 100644 --- a/users/app/controllers/v1/users_controller.rb +++ b/users/app/controllers/v1/users_controller.rb @@ -18,17 +18,23 @@ module V1 end def create - @user = User.create(params[:user]) + @user = signup_service.register(params[:user]) respond_with @user # return ID instead? end def update - @user.update_attributes params[:user] - if @user.valid? - flash[:notice] = t(:user_updated_successfully) - end + account_settings.update params[:user] respond_with @user end + protected + + def account_settings + AccountSettings.new(@user) + end + + def signup_service + SignupService.new + end end end |