debian-mirror-gitlab/app/models/ci/job_variable.rb

18 lines
426 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
module Ci
class JobVariable < ApplicationRecord
extend Gitlab::Ci::Model
2020-04-22 19:07:51 +05:30
include Ci::NewHasVariable
2020-04-08 14:13:33 +05:30
include BulkInsertSafe
2019-10-12 21:52:04 +05:30
belongs_to :job, class_name: "Ci::Build", foreign_key: :job_id
alias_attribute :secret_value, :value
2020-04-08 14:13:33 +05:30
validates :key, uniqueness: { scope: :job_id }, unless: :dotenv_source?
enum source: { internal: 0, dotenv: 1 }, _suffix: true
2019-10-12 21:52:04 +05:30
end
end