summaryrefslogtreecommitdiff
path: root/app/services/keys/destroy_service.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 09:55:51 +0000
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /app/services/keys/destroy_service.rb
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
downloadgitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/services/keys/destroy_service.rb')
-rw-r--r--app/services/keys/destroy_service.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/services/keys/destroy_service.rb b/app/services/keys/destroy_service.rb
index eaf5eb35f58..c7ebb484e94 100644
--- a/app/services/keys/destroy_service.rb
+++ b/app/services/keys/destroy_service.rb
@@ -3,14 +3,22 @@
module Keys
class DestroyService < ::Keys::BaseService
def execute(key)
- key.destroy if destroy_possible?(key)
+ return unless destroy_possible?(key)
+
+ destroy(key)
end
+ private
+
# overridden in EE::Keys::DestroyService
def destroy_possible?(key)
true
end
+
+ def destroy(key)
+ key.destroy
+ end
end
end
-Keys::DestroyService.prepend_mod_with('Keys::DestroyService')
+Keys::DestroyService.prepend_mod