diff options
author | jessib <jessib@riseup.net> | 2013-08-08 11:54:19 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-08-08 11:54:19 -0700 |
commit | bca39b8f0d44dc31f77a3bfc8a94d452b4c77670 (patch) | |
tree | e3ee949bf6e02fc1bbc2ab8e3f247105b962b08e /users/app/controllers/v1 | |
parent | 31441fc921c3a60bff7c606f1da343fdd62d80d5 (diff) | |
parent | b1065710102193ba11e2a18b5f6506ba1d5b31f9 (diff) |
Merge pull request #64 from azul/feature/identity-rewrite
Feature/identity rewrite
Diffstat (limited to 'users/app/controllers/v1')
-rw-r--r-- | users/app/controllers/v1/users_controller.rb | 16 |
1 files changed, 11 insertions, 5 deletions
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 |