Add a new relation between a stage and related bridges
This commit is contained in:
parent
cfbcc191f0
commit
3508948dfe
|
@ -14,6 +14,7 @@ module Ci
|
|||
|
||||
has_many :statuses, class_name: 'CommitStatus', foreign_key: :stage_id
|
||||
has_many :builds, foreign_key: :stage_id
|
||||
has_many :bridges, foreign_key: :stage_id
|
||||
|
||||
with_options unless: :importing? do
|
||||
validates :project, presence: true
|
||||
|
|
|
@ -41,7 +41,7 @@ module Gitlab
|
|||
::Ci::Stage.new(attributes).tap do |stage|
|
||||
seeds.each do |seed|
|
||||
if seed.bridge?
|
||||
stage.statuses << seed.to_resource
|
||||
stage.bridges << seed.to_resource
|
||||
else
|
||||
stage.builds << seed.to_resource
|
||||
end
|
||||
|
|
|
@ -138,6 +138,7 @@ stages:
|
|||
- pipeline
|
||||
- statuses
|
||||
- builds
|
||||
- bridges
|
||||
statuses:
|
||||
- project
|
||||
- pipeline
|
||||
|
|
Loading…
Reference in New Issue