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

17 lines
401 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
module Ci
2021-10-27 15:23:28 +05:30
class JobVariable < Ci::ApplicationRecord
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