Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-07-20 20:00:09 +0300
committerRobert Speicher <rspeicher@gmail.com>2018-07-20 20:00:09 +0300
commit0f02ce3563716659e0facb15e4c682970634d922 (patch)
treed56b07736af1c28e4d773569104ffd62e7dca84e /lib/api
parentc0c58167d372a7ae08a1f998d345448ac351fc7d (diff)
Ensure a job preloads the project's namespace to avoid N+1
Diffstat (limited to 'lib/api')
-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