Welcome to mirror list, hosted at ThFree Co, Russian Federation.

group_variable.rb « ci « models « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1e1dd68ee6c8bf50279830af662d3789d9f46fc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Ci
  class GroupVariable < ApplicationRecord
    extend Gitlab::Ci::Model
    include Ci::HasVariable
    include Presentable
    include Ci::Maskable

    belongs_to :group, class_name: "::Group"

    alias_attribute :secret_value, :value

    validates :key, uniqueness: {
      scope: :group_id,
      message: "(%{value}) has already been taken"
    }

    scope :unprotected, -> { where(protected: false) }
  end
end