2018-08-03 03:15:25 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-07-26 05:31:09 -04:00
|
|
|
module Ci
|
2019-03-28 09:17:42 -04:00
|
|
|
class PipelineVariable < ApplicationRecord
|
2017-09-06 07:13:52 -04:00
|
|
|
extend Gitlab::Ci::Model
|
2020-03-18 08:09:13 -04:00
|
|
|
include Ci::HasVariable
|
2017-07-26 05:31:09 -04:00
|
|
|
|
|
|
|
belongs_to :pipeline
|
|
|
|
|
2018-04-18 11:32:33 -04:00
|
|
|
alias_attribute :secret_value, :value
|
|
|
|
|
2017-07-26 05:31:09 -04:00
|
|
|
validates :key, uniqueness: { scope: :pipeline_id }
|
2018-10-01 13:22:41 -04:00
|
|
|
|
|
|
|
def hook_attrs
|
|
|
|
{ key: key, value: value }
|
|
|
|
end
|
2017-07-26 05:31:09 -04:00
|
|
|
end
|
|
|
|
end
|