summaryrefslogtreecommitdiff
path: root/app/models/ci
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-02-27 10:03:19 +0000
committerPhil Hughes <me@iamphill.com>2018-02-27 10:03:19 +0000
commit27ca41ac3c9442312f440d78f70628d0ac6826ff (patch)
treeefde2a9ba11741c94edf288cdae18cd4379a5515 /app/models/ci
parent9167989f3e9a8e5ee4c84600102e67d5799a9feb (diff)
parenta4885b8f37602c399efff028b0a733ef80fbe7ab (diff)
downloadgitlab-ce-refactor-commit-show.tar.gz
Merge branch 'master' into 'refactor-commit-show'refactor-commit-show
# Conflicts: # config/webpack.config.js
Diffstat (limited to 'app/models/ci')
-rw-r--r--app/models/ci/group_variable.rb5
-rw-r--r--app/models/ci/variable.rb5
2 files changed, 8 insertions, 2 deletions
diff --git a/app/models/ci/group_variable.rb b/app/models/ci/group_variable.rb
index afeae69ba39..1dd0e050ba9 100644
--- a/app/models/ci/group_variable.rb
+++ b/app/models/ci/group_variable.rb
@@ -6,7 +6,10 @@ module Ci
belongs_to :group
- validates :key, uniqueness: { scope: :group_id }
+ validates :key, uniqueness: {
+ scope: :group_id,
+ message: "(%{value}) has already been taken"
+ }
scope :unprotected, -> { where(protected: false) }
end
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