summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline_variable.rb
blob: 51a6272e1ffb42ca2aa2249fcb28bb56f7f2cfe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module Ci
  class PipelineVariable < ApplicationRecord
    extend Gitlab::Ci::Model
    include HasVariable

    belongs_to :pipeline

    alias_attribute :secret_value, :value

    validates :key, uniqueness: { scope: :pipeline_id }

    def hook_attrs
      { key: key, value: value }
    end
  end
end