summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-08-21 12:19:05 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-08-21 12:21:08 +0100
commitee7e4fd34196003d8f3899704e5c537d965b7a9a (patch)
tree9e2270f75a998aca520af1869b5d4dfaa4d0a02c
parent1fdd1fa6ae7bd1bda3235bfa8685463fb5597646 (diff)
downloadgitlab-ci-ee7e4fd34196003d8f3899704e5c537d965b7a9a.tar.gz
Fix problem with variables saving
-rw-r--r--CHANGELOG1
-rw-r--r--app/models/variable.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f2c33fa..3d3b2ef 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,7 @@ v7.14.0 (unreleased)
- Rename type(s) to stage(s)
- Add missing stage when doing retry
- Require variable keys to be not-empty and unique
+ - Fix variable saving issue
v7.13.1
- Fix: user could steal specific runner
diff --git a/app/models/variable.rb b/app/models/variable.rb
index 559b9f2..c084b89 100644
--- a/app/models/variable.rb
+++ b/app/models/variable.rb
@@ -15,7 +15,7 @@ class Variable < ActiveRecord::Base
belongs_to :project
validates_presence_of :key
- validates_uniqueness_of :key
+ validates_uniqueness_of :key, scope: :project_id
attr_encrypted :value, mode: :per_attribute_iv_and_salt, key: GitlabCi::Application.secrets.db_key_base
end