summaryrefslogtreecommitdiff
path: root/app/models/ci/group_variable.rb
blob: 1dd0e050ba917edf9bd5a4f6e5f249e68097e52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Ci
  class GroupVariable < ActiveRecord::Base
    extend Gitlab::Ci::Model
    include HasVariable
    include Presentable

    belongs_to :group

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

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