summaryrefslogtreecommitdiff
path: root/app/services/keys
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/keys')
-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