diff options
author | James Lopez <james@jameslopez.es> | 2017-09-20 12:00:06 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-09-28 09:46:39 +0300 |
commit | 9621dd0c9d31508bdac2e2e226537302b560ef10 (patch) | |
tree | f4e76be89a6cb1a85b04e87cdf33bb408f2bf63f /app/controllers/profiles_controller.rb | |
parent | 11c8b8bc3c2294ef2e3a33196619f6e61f1e8d82 (diff) |
refactor services to match EE signature
Diffstat (limited to 'app/controllers/profiles_controller.rb')
-rw-r--r-- | app/controllers/profiles_controller.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index d83824fef06..9e85997cf6d 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -10,7 +10,7 @@ class ProfilesController < Profiles::ApplicationController def update respond_to do |format| - result = Users::UpdateService.new(@user, user_params).execute + result = Users::UpdateService.new(current_user, @user, user_params).execute if result[:status] == :success message = "Profile was successfully updated" @@ -25,7 +25,7 @@ class ProfilesController < Profiles::ApplicationController end def reset_private_token - Users::UpdateService.new(@user).execute! do |user| + Users::UpdateService.new(current_user, @user).execute! do |user| user.reset_authentication_token! end @@ -35,7 +35,7 @@ class ProfilesController < Profiles::ApplicationController end def reset_incoming_email_token - Users::UpdateService.new(@user).execute! do |user| + Users::UpdateService.new(current_user, @user).execute! do |user| user.reset_incoming_email_token! end @@ -45,7 +45,7 @@ class ProfilesController < Profiles::ApplicationController end def reset_rss_token - Users::UpdateService.new(@user).execute! do |user| + Users::UpdateService.new(current_user, @user).execute! do |user| user.reset_rss_token! end @@ -61,7 +61,7 @@ class ProfilesController < Profiles::ApplicationController end def update_username - result = Users::UpdateService.new(@user, username: user_params[:username]).execute + result = Users::UpdateService.new(current_user, @user, username: user_params[:username]).execute options = if result[:status] == :success { notice: "Username successfully changed" } |