diff options
author | James Lopez <james@jameslopez.es> | 2017-06-22 09:55:07 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-06-23 12:41:42 +0300 |
commit | 785cbb79e255c8369ca5eb916207304f39d188ad (patch) | |
tree | abd792d12be1f35d868db591793311eb32d92370 /app/controllers/profiles | |
parent | 0c8e7f49d1ef32ed5ea1bdd7e26dd5e169bad359 (diff) |
refactor emails service
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r-- | app/controllers/profiles/emails_controller.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/profiles/emails_controller.rb b/app/controllers/profiles/emails_controller.rb index 40b43278439..5c7a5fa9a64 100644 --- a/app/controllers/profiles/emails_controller.rb +++ b/app/controllers/profiles/emails_controller.rb @@ -18,9 +18,7 @@ class Profiles::EmailsController < Profiles::ApplicationController def destroy @email = current_user.emails.find(params[:id]) - Emails::DestroyService.new(self, self, email: @email.email).execute - - Users::UpdateService.new(current_user, current_user).execute { |user| user.update_secondary_emails! } + Emails::DestroyService.new(current_user, current_user, email: @email.email).execute respond_to do |format| format.html { redirect_to profile_emails_url, status: 302 } |