Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-09-20 12:00:06 +0300
committerJames Lopez <james@jameslopez.es>2017-09-28 09:46:39 +0300
commit9621dd0c9d31508bdac2e2e226537302b560ef10 (patch)
treef4e76be89a6cb1a85b04e87cdf33bb408f2bf63f /app/services/emails
parent11c8b8bc3c2294ef2e3a33196619f6e61f1e8d82 (diff)
refactor services to match EE signature
Diffstat (limited to 'app/services/emails')
-rw-r--r--app/services/emails/destroy_service.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/services/emails/destroy_service.rb b/app/services/emails/destroy_service.rb
index d586b9dfe0c..02dd803fca6 100644
--- a/app/services/emails/destroy_service.rb
+++ b/app/services/emails/destroy_service.rb
@@ -1,13 +1,13 @@
module Emails
class DestroyService < ::Emails::BaseService
def execute
- Email.find_by_email!(@email).destroy && update_secondary_emails!
+ update_secondary_emails! if Email.find_by_email!(@email).destroy
end
private
def update_secondary_emails!
- result = ::Users::UpdateService.new(@user).execute do |user|
+ result = ::Users::UpdateService.new(@current_user, @user).execute do |user|
user.update_secondary_emails!
end