diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 18:08:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 18:08:58 +0000 |
commit | 1ca9950d5f890cd8f185e1eda158b969a7244fe2 (patch) | |
tree | 6f62715938a4b2b001705c51c697609a8e0850ae /app/models/project.rb | |
parent | bcc77054ee9aefd1e332e04a4189390fd5a3112e (diff) | |
download | gitlab-ce-1ca9950d5f890cd8f185e1eda158b969a7244fe2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index b5639039bb6..44701ef792a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1224,13 +1224,13 @@ class Project < ApplicationRecord service = find_service(services, name) return service if service - # We should check if an instance-level service exists - instance_level_service = find_service(instance_level_services, name) + # We should check if template for the service exists + template = find_service(services_templates, name) - if instance_level_service - Service.build_from_instance(id, instance_level_service) + if template + Service.build_from_template(id, template) else - # If no instance-level service exists, we should create a new service. Ex `build_gitlab_ci_service` + # If no template, we should create an instance. Ex `build_gitlab_ci_service` public_send("build_#{name}_service") # rubocop:disable GitlabSecurity/PublicSend end end @@ -2460,8 +2460,8 @@ class Project < ApplicationRecord end end - def instance_level_services - @instance_level_services ||= Service.where(instance: true) + def services_templates + @services_templates ||= Service.where(template: true) end def ensure_pages_metadatum |