summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/clusters/applications/base_service.rb4
-rw-r--r--app/services/clusters/applications/create_service.rb2
-rw-r--r--app/services/clusters/applications/destroy_service.rb2
-rw-r--r--app/services/clusters/applications/update_service.rb2
-rw-r--r--app/services/protected_branches/destroy_service.rb2
-rw-r--r--app/services/protected_branches/update_service.rb2
6 files changed, 11 insertions, 3 deletions
diff --git a/app/services/clusters/applications/base_service.rb b/app/services/clusters/applications/base_service.rb
index a9feb60be6e..67fb3ac8355 100644
--- a/app/services/clusters/applications/base_service.rb
+++ b/app/services/clusters/applications/base_service.rb
@@ -77,6 +77,10 @@ module Clusters
params[:application]
end
+ def application_class
+ Clusters::Cluster::APPLICATIONS[application_name]
+ end
+
def create_oauth_application(application, request)
oauth_application_params = {
name: params[:application],
diff --git a/app/services/clusters/applications/create_service.rb b/app/services/clusters/applications/create_service.rb
index f723c42c049..2a626a402e4 100644
--- a/app/services/clusters/applications/create_service.rb
+++ b/app/services/clusters/applications/create_service.rb
@@ -10,7 +10,7 @@ module Clusters
end
def builder
- cluster.public_send(:"application_#{application_name}") || # rubocop:disable GitlabSecurity/PublicSend
+ cluster.public_send(application_class.association_name) || # rubocop:disable GitlabSecurity/PublicSend
cluster.public_send(:"build_application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
end
end
diff --git a/app/services/clusters/applications/destroy_service.rb b/app/services/clusters/applications/destroy_service.rb
index f3a4c4f754a..d666682487b 100644
--- a/app/services/clusters/applications/destroy_service.rb
+++ b/app/services/clusters/applications/destroy_service.rb
@@ -16,7 +16,7 @@ module Clusters
private
def builder
- cluster.public_send(:"application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
+ cluster.public_send(application_class.association_name) # rubocop:disable GitlabSecurity/PublicSend
end
end
end
diff --git a/app/services/clusters/applications/update_service.rb b/app/services/clusters/applications/update_service.rb
index 0fa937da865..7a36401f156 100644
--- a/app/services/clusters/applications/update_service.rb
+++ b/app/services/clusters/applications/update_service.rb
@@ -10,7 +10,7 @@ module Clusters
end
def builder
- cluster.public_send(:"application_#{application_name}") # rubocop:disable GitlabSecurity/PublicSend
+ cluster.public_send(application_class.association_name) # rubocop:disable GitlabSecurity/PublicSend
end
end
end
diff --git a/app/services/protected_branches/destroy_service.rb b/app/services/protected_branches/destroy_service.rb
index 7190bc2001b..acd15b0214f 100644
--- a/app/services/protected_branches/destroy_service.rb
+++ b/app/services/protected_branches/destroy_service.rb
@@ -9,3 +9,5 @@ module ProtectedBranches
end
end
end
+
+ProtectedBranches::DestroyService.prepend_if_ee('EE::ProtectedBranches::DestroyService')
diff --git a/app/services/protected_branches/update_service.rb b/app/services/protected_branches/update_service.rb
index 4d7d498b8ca..226aefb64d0 100644
--- a/app/services/protected_branches/update_service.rb
+++ b/app/services/protected_branches/update_service.rb
@@ -10,3 +10,5 @@ module ProtectedBranches
end
end
end
+
+ProtectedBranches::UpdateService.prepend_if_ee('EE::ProtectedBranches::UpdateService')