diff options
author | Azul <azul@leap.se> | 2013-07-19 16:02:02 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-07-24 10:56:45 +0200 |
commit | d70c5796a2989b7b43f7e287899fb1394ae28280 (patch) | |
tree | daeabe5bdcc2386a201d88d838b4b1e387dd9ee3 /users/app/controllers | |
parent | c0527cc18788fc60180d9293a546c93e6a77b788 (diff) |
separate signup and settings service objects for user
Diffstat (limited to 'users/app/controllers')
-rw-r--r-- | users/app/controllers/v1/users_controller.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/users/app/controllers/v1/users_controller.rb b/users/app/controllers/v1/users_controller.rb index 467c9b4..f380c19 100644 --- a/users/app/controllers/v1/users_controller.rb +++ b/users/app/controllers/v1/users_controller.rb @@ -18,14 +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] + 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 |