summaryrefslogtreecommitdiff
path: root/app/models/service.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 15:07:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-05 15:07:52 +0000
commitafe2b984524ae4b0c8a0636db7ec5b2c452f0734 (patch)
tree3de39f954c7239e09a9afe84263a64e7042b2b60 /app/models/service.rb
parent5a6b36b60502c50ab59c0bc3c345793b70a3d548 (diff)
downloadgitlab-ce-afe2b984524ae4b0c8a0636db7ec5b2c452f0734.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/service.rb')
-rw-r--r--app/models/service.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/service.rb b/app/models/service.rb
index 41ae197f432..e6b32db7eef 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -34,6 +34,7 @@ class Service < ApplicationRecord
validates :project_id, presence: true, unless: -> { template? }
validates :type, presence: true
+ validates :template, uniqueness: { scope: :type }, if: -> { template? }
scope :visible, -> { where.not(type: 'GitlabIssueTrackerService') }
scope :issue_trackers, -> { where(category: 'issue_tracker') }