From 785cbb79e255c8369ca5eb916207304f39d188ad Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 22 Jun 2017 08:55:07 +0200 Subject: refactor emails service --- app/controllers/profiles/emails_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/controllers/profiles') 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 } -- cgit v1.2.3