summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline_variable.rb
blob: 08514d6af4e9ab1c7650674850cb82c56b64ea72 (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 < ActiveRecord::Base
    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