Allow passing exceptions when creating project services

This commit is contained in:
Sean McGivern 2017-07-10 10:15:26 +01:00
parent 64701b51ae
commit 8947232be7
1 changed files with 4 additions and 2 deletions

View File

@ -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