summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-06-19 14:51:46 +0200
committerJames Lopez <james@jameslopez.es>2017-06-23 11:41:42 +0200
commit87bf08c96cf9f3c451d0746d11ceac149adf22db (patch)
tree77c335814ece5510856135a5ba13dee39017f4a6
parent3bab585bec5529c06ba4b0c4ae7e953b99edf6d3 (diff)
downloadgitlab-ce-87bf08c96cf9f3c451d0746d11ceac149adf22db.tar.gz
fix specs
-rw-r--r--app/services/emails/create_service.rb2
-rw-r--r--app/services/emails/destroy_service.rb2
-rw-r--r--lib/api/users.rb4
3 files changed, 4 insertions, 4 deletions
diff --git a/app/services/emails/create_service.rb b/app/services/emails/create_service.rb
index 5d5655256fa..95e226ec710 100644
--- a/app/services/emails/create_service.rb
+++ b/app/services/emails/create_service.rb
@@ -1,5 +1,5 @@
module Emails
- class CreateService < BaseService
+ class CreateService < ::Emails::BaseService
def execute(skip_authorization: false)
raise Gitlab::Access::AccessDeniedError unless skip_authorization || can_manage_emails?
diff --git a/app/services/emails/destroy_service.rb b/app/services/emails/destroy_service.rb
index c5fbc32033b..1275d31efb0 100644
--- a/app/services/emails/destroy_service.rb
+++ b/app/services/emails/destroy_service.rb
@@ -1,5 +1,5 @@
module Emails
- class DestroyService < BaseService
+ class DestroyService < ::Emails::BaseService
def execute(skip_authorization: false)
raise Gitlab::Access::AccessDeniedError unless skip_authorization || can_manage_emails?
diff --git a/lib/api/users.rb b/lib/api/users.rb
index 236bae4a299..940f8b64026 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -276,7 +276,7 @@ module API
email = user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
- Emails::DestroyService.new(current_user, self, email: email.email).execute
+ Emails::DestroyService.new(current_user, user, email: email.email).execute
::Users::UpdateService.new(current_user, user).execute do |user|
user.update_secondary_emails!
@@ -510,7 +510,7 @@ module API
email = current_user.emails.find_by(id: params[:email_id])
not_found!('Email') unless email
- Emails::DestroyService.new(current_user, self, email: email.email).execute
+ Emails::DestroyService.new(current_user, current_user, email: email.email).execute
::Users::UpdateService.new(current_user, current_user).execute do |user|
user.update_secondary_emails!