summaryrefslogtreecommitdiff
path: root/app/models/ci/job_variable.rb
blob: 7eea8a37150a7b750bb133290dbab894baa11acc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Ci
  class JobVariable < ApplicationRecord
    extend Gitlab::Ci::Model
    include Ci::NewHasVariable
    include BulkInsertSafe

    belongs_to :job, class_name: "Ci::Build", foreign_key: :job_id

    alias_attribute :secret_value, :value

    validates :key, uniqueness: { scope: :job_id }, unless: :dotenv_source?

    enum source: { internal: 0, dotenv: 1 }, _suffix: true
  end
end