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