summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-03-22 12:20:44 -0300
committerFelipe Artur <felipefac@gmail.com>2017-05-08 11:24:55 -0300
commit85f0b3a984048d1e5d146a233612a0bc96f12b5c (patch)
tree5161ccee6916d8a4c8cd776aa6f665ee0ca71e0e /app/models
parent4ae411ff40352ec21bd10f859b7f3f9f85a7aee6 (diff)
downloadgitlab-ce-85f0b3a984048d1e5d146a233612a0bc96f12b5c.tar.gz
Add merge requests association to pipeline
Diffstat (limited to 'app/models')
-rw-r--r--app/models/ci/pipeline.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index db994b861e5..481f9c8dac8 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -17,6 +17,7 @@ module Ci
has_many :statuses, class_name: 'CommitStatus', foreign_key: :commit_id
has_many :builds, foreign_key: :commit_id
has_many :trigger_requests, dependent: :destroy, foreign_key: :commit_id
+ has_many :merge_requests, foreign_key: "head_pipeline_id"
has_many :pending_builds, -> { pending }, foreign_key: :commit_id, class_name: 'Ci::Build'
has_many :retryable_builds, -> { latest.failed_or_canceled }, foreign_key: :commit_id, class_name: 'Ci::Build'