diff options
author | Robert Speicher <rspeicher@gmail.com> | 2018-07-20 10:00:09 -0700 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-07-20 10:00:09 -0700 |
commit | 0f02ce3563716659e0facb15e4c682970634d922 (patch) | |
tree | d56b07736af1c28e4d773569104ffd62e7dca84e /lib/api/jobs.rb | |
parent | c0c58167d372a7ae08a1f998d345448ac351fc7d (diff) | |
download | gitlab-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.rb | 2 |
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 |