summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-10 10:15:26 +0100
committerSean McGivern <sean@gitlab.com>2017-07-10 10:15:26 +0100
commit8947232be7e39d5da12b1cf72e80d68fa2188464 (patch)
tree28081f982a423fc80a73be67f815b9f8d6ef9d6e
parent64701b51aeacf4f4f932f205a2d831880b757a43 (diff)
downloadgitlab-ce-backport-exceptions-argument.tar.gz
Allow passing exceptions when creating project servicesbackport-exceptions-argument
-rw-r--r--app/models/project.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index d0e02e4e585..d5760164663 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -801,10 +801,12 @@ class Project < ActiveRecord::Base
update_column(:has_external_wiki, services.external_wikis.any?)
end
- def find_or_initialize_services
+ def find_or_initialize_services(exceptions: [])
services_templates = Service.where(template: true)
- Service.available_services_names.map do |service_name|
+ available_services_names = Service.available_services_names - exceptions
+
+ available_services_names.map do |service_name|
service = find_service(services, service_name)
if service