diff options
| author | Matija Čupić <matteeyah@gmail.com> | 2018-02-23 01:19:46 +0100 |
|---|---|---|
| committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-23 01:19:46 +0100 |
| commit | f2695aa84b68cd905eff90c598e452cbf63d98ed (patch) | |
| tree | 88fa3b334d594b22f51531edf922279ba41fba5f /app/models/ci/variable.rb | |
| parent | c7dac22e52ceb6f47492af0cc57ce3f16894b90f (diff) | |
| download | gitlab-ce-f2695aa84b68cd905eff90c598e452cbf63d98ed.tar.gz | |
Include CI Variable Key in its uniqueness validation error message43275-improve-variables-validation-message
Diffstat (limited to 'app/models/ci/variable.rb')
| -rw-r--r-- | app/models/ci/variable.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/ci/variable.rb b/app/models/ci/variable.rb index 67d3ec81b6f..7c71291de84 100644 --- a/app/models/ci/variable.rb +++ b/app/models/ci/variable.rb @@ -6,7 +6,10 @@ module Ci belongs_to :project - validates :key, uniqueness: { scope: [:project_id, :environment_scope] } + validates :key, uniqueness: { + scope: [:project_id, :environment_scope], + message: "(%{value}) has already been taken" + } scope :unprotected, -> { where(protected: false) } end |
