trigger_request.rb 413 字节
Newer Older
D
Douwe Maan 已提交
1 2 3
module Ci
  class TriggerRequest < ActiveRecord::Base
    extend Ci::Model
4

5 6 7
    belongs_to :trigger
    belongs_to :pipeline, foreign_key: :commit_id
    has_many :builds
D
Douwe Maan 已提交
8

9
    serialize :variables # rubocop:disable Cop/ActiveRecordSerialize
10 11 12 13 14 15 16 17

    def user_variables
      return [] unless variables

      variables.map do |key, value|
        { key: key, value: value, public: false }
      end
    end
D
Douwe Maan 已提交
18 19
  end
end