2019-07-29 03:43:10 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Ci
|
2021-08-03 02:08:50 -04:00
|
|
|
class JobVariable < Ci::ApplicationRecord
|
2020-03-18 08:09:13 -04:00
|
|
|
include Ci::NewHasVariable
|
2022-10-24 05:11:03 -04:00
|
|
|
include Ci::RawVariable
|
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
|