Validate project variables by scope

This commit is contained in:
Matija Čupić 2018-02-13 14:52:49 +01:00
parent 532a966410
commit cb295ba5bd
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 1 additions and 1 deletions

View File

@ -261,7 +261,7 @@ class Project < ActiveRecord::Base
validates :repository_storage,
presence: true,
inclusion: { in: ->(_object) { Gitlab.config.repositories.storages.keys } }
validates :variables, variable_duplicates: true
validates :variables, variable_duplicates: { scope: :environment_scope }
has_many :uploads, as: :model, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent