diff options
author | James Lopez <james@jameslopez.es> | 2017-06-14 13:39:58 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-23 12:41:41 +0300 |
commit | 01378ab4a57dfbca589efdffb6d13e1830913106 (patch) | |
tree | 4723e360808c405648a0b8f89a2a600166097a13 /app/services | |
parent | 59c3968c40a1146f5370ae3b634aac2d4a045733 (diff) |
update profiles controller to use new service
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/users/update_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/users/update_service.rb b/app/services/users/update_service.rb index 866eb070913..977124298bf 100644 --- a/app/services/users/update_service.rb +++ b/app/services/users/update_service.rb @@ -10,17 +10,17 @@ module Users def execute(skip_authorization: false, &block) assign_attributes(skip_authorization, &block) - if @user.save + if @user.save || !@user.changed? success else - error('User could not be updated') + error("User could not be updated #{@user.errors.full_messages.uniq.join('. ')}" ) end end def execute!(skip_authorization: false, &block) assign_attributes(skip_authorization, &block) - @user.save! + @user.save! if @user.changed? end private |