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

20 lines
449 B
Ruby
Raw Normal View History

2015-09-25 12:07:36 +05:30
module Ci
class TriggerRequest < ActiveRecord::Base
extend Ci::Model
2016-08-24 12:49:21 +05:30
2015-09-25 12:07:36 +05:30
belongs_to :trigger, class_name: 'Ci::Trigger'
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id
2015-09-25 12:07:36 +05:30
has_many :builds, class_name: 'Ci::Build'
serialize :variables
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