Add a new relation between a stage and related bridges

This commit is contained in:
Grzegorz Bizon 2019-01-23 11:15:14 +01:00
parent cfbcc191f0
commit 3508948dfe
3 changed files with 3 additions and 1 deletions

View File

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

View File

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

View File

@ -138,6 +138,7 @@ stages:
- pipeline
- statuses
- builds
- bridges
statuses:
- project
- pipeline