diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-16 18:18:33 +0000 |
commit | f64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch) | |
tree | a2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/models/ci/group_variable.rb | |
parent | bfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff) | |
download | gitlab-ce-f64a639bcfa1fc2bc89ca7db268f594306edfd7c.tar.gz |
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/models/ci/group_variable.rb')
-rw-r--r-- | app/models/ci/group_variable.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/ci/group_variable.rb b/app/models/ci/group_variable.rb index 1e1dd68ee6c..2928ce801ad 100644 --- a/app/models/ci/group_variable.rb +++ b/app/models/ci/group_variable.rb @@ -6,16 +6,18 @@ module Ci include Ci::HasVariable include Presentable include Ci::Maskable + prepend HasEnvironmentScope belongs_to :group, class_name: "::Group" alias_attribute :secret_value, :value validates :key, uniqueness: { - scope: :group_id, + scope: [:group_id, :environment_scope], message: "(%{value}) has already been taken" } scope :unprotected, -> { where(protected: false) } + scope :by_environment_scope, -> (environment_scope) { where(environment_scope: environment_scope) } end end |