summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 21:09:22 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 21:09:22 +0000
commit8b5c2a4525819c6b18f422b4baa0f6568286909b (patch)
tree7c59a1e6b4b411c88b53eb046121e9d9b25930df /app
parent5bfb8d1fad825eec90b0af688c7cd1b352c9056e (diff)
downloadgitlab-ce-8b5c2a4525819c6b18f422b4baa0f6568286909b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-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 d866eeb3531..5782fab3266 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? || instance? }
validates :project_id, absence: true, if: -> { template? || instance? }
+ validates :type, uniqueness: { scope: :project_id }, unless: -> { template? || instance? }, on: :create
validates :type, presence: true
validates :template, uniqueness: { scope: :type }, if: -> { template? }
validates :instance, uniqueness: { scope: :type }, if: -> { instance? }