summaryrefslogtreecommitdiff
path: root/lib/api/jobs.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-07-20 10:00:09 -0700
committerRobert Speicher <rspeicher@gmail.com>2018-07-20 10:00:09 -0700
commit0f02ce3563716659e0facb15e4c682970634d922 (patch)
treed56b07736af1c28e4d773569104ffd62e7dca84e /lib/api/jobs.rb
parentc0c58167d372a7ae08a1f998d345448ac351fc7d (diff)
downloadgitlab-ce-0f02ce3563716659e0facb15e4c682970634d922.tar.gz
Ensure a job preloads the project's namespace to avoid N+1
Diffstat (limited to 'lib/api/jobs.rb')
-rw-r--r--lib/api/jobs.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index e95b0dd5267..10c6e565f09 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -54,7 +54,7 @@ module API
pipeline = user_project.pipelines.find(params[:pipeline_id])
builds = pipeline.builds
builds = filter_builds(builds, params[:scope])
- builds = builds.preload(:job_artifacts_archive)
+ builds = builds.preload(:job_artifacts_archive, project: [:namespace])
present paginate(builds), with: Entities::Job
end