summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-04 18:00:39 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-07-04 21:56:41 +0800
commita4dd3ea168d19d2b65b7e55ed0043c7e7dcac77c (patch)
tree3eb2e1bbb8ec11ec9517db418449d31d8cc324f5
parent216bf78fd154005cbf8ec447bfa23f77f6b26775 (diff)
downloadgitlab-ce-a4dd3ea168d19d2b65b7e55ed0043c7e7dcac77c.tar.gz
Make sure that retryable_builds would preload project
-rw-r--r--app/models/ci/pipeline.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index bea2ec1e18c..7963386bdb1 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -21,7 +21,7 @@ module Ci
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'
+ has_many :retryable_builds, -> { latest.failed_or_canceled.includes(:project) }, foreign_key: :commit_id, class_name: 'Ci::Build'
has_many :cancelable_statuses, -> { cancelable }, foreign_key: :commit_id, class_name: 'CommitStatus'
has_many :manual_actions, -> { latest.manual_actions.includes(:project) }, foreign_key: :commit_id, class_name: 'Ci::Build'
has_many :artifacts, -> { latest.with_artifacts_not_expired.includes(:project) }, foreign_key: :commit_id, class_name: 'Ci::Build'