2019-07-29 03:43:10 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
|
|
|
class JobVariable < ApplicationRecord
|
|
|
|
extend Gitlab::Ci::Model
|
2020-03-18 08:09:13 -04:00
|
|
|
include Ci::NewHasVariable
|
2020-03-13 17:09:38 -04:00
|
|
|
include BulkInsertSafe
|
2019-07-29 03:43:10 -04:00
|
|
|
|
|
|
|
belongs_to :job, class_name: "Ci::Build", foreign_key: :job_id
|
|
|
|
|
|
|
|
alias_attribute :secret_value, :value
|
|
|
|
|
2020-03-13 17:09:38 -04:00
|
|
|
validates :key, uniqueness: { scope: :job_id }, unless: :dotenv_source?
|
|
|
|
|
|
|
|
enum source: { internal: 0, dotenv: 1 }, _suffix: true
|
2019-07-29 03:43:10 -04:00
|
|
|
end
|
|
|
|
end
|