2015-08-25 21:42:46 -04:00
|
|
|
module Ci
|
|
|
|
class TriggerRequest < ActiveRecord::Base
|
|
|
|
extend Ci::Model
|
2016-07-03 19:58:58 -04:00
|
|
|
|
2015-08-25 21:42:46 -04:00
|
|
|
belongs_to :trigger, class_name: 'Ci::Trigger'
|
2016-06-07 08:51:00 -04:00
|
|
|
belongs_to :pipeline, class_name: 'Ci::Pipeline', foreign_key: :commit_id
|
2015-08-25 21:42:46 -04:00
|
|
|
has_many :builds, class_name: 'Ci::Build'
|
|
|
|
|
|
|
|
serialize :variables
|
2016-07-20 07:17:21 -04:00
|
|
|
|
|
|
|
def user_variables
|
|
|
|
return [] unless variables
|
|
|
|
|
|
|
|
variables.map do |key, value|
|
|
|
|
{ key: key, value: value, public: false }
|
|
|
|
end
|
|
|
|
end
|
2015-08-25 21:42:46 -04:00
|
|
|
end
|
|
|
|
end
|