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

26 lines
627 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2015-09-25 12:07:36 +05:30
module Ci
class TriggerRequest < ActiveRecord::Base
2018-03-17 18:26:18 +05:30
extend Gitlab::Ci::Model
2016-08-24 12:49:21 +05:30
2017-08-17 22:00:37 +05:30
belongs_to :trigger
belongs_to :pipeline, foreign_key: :commit_id
has_many :builds
2015-09-25 12:07:36 +05:30
2018-03-17 18:26:18 +05:30
# We switched to Ci::PipelineVariable from Ci::TriggerRequest.variables.
# Ci::TriggerRequest doesn't save variables anymore.
validates :variables, absence: true
2017-09-10 17:25:29 +05:30
serialize :variables # rubocop:disable Cop/ActiveRecordSerialize
2016-08-24 12:49:21 +05:30
def user_variables
return [] unless variables
variables.map do |key, value|
{ key: key, value: value, public: false }
end
end
2015-09-25 12:07:36 +05:30
end
end