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
|
|
|
|
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
|
|
|
|
|
|
|
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
|