summaryrefslogtreecommitdiff
path: root/lib/api/jobs.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-14 23:13:18 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-01-14 23:14:11 +0100
commit87cc03736ccaa91db51e171883ef2e2a05a74360 (patch)
treef8d41dda86f9a44d080304d9bf044b0c8239e75d /lib/api/jobs.rb
parent091187962372673f0fa7c6f3a0e66cb14bc1b097 (diff)
downloadgitlab-ce-87cc03736ccaa91db51e171883ef2e2a05a74360.tar.gz
Fix N+1 builds query in Jobs list API
Diffstat (limited to 'lib/api/jobs.rb')
-rw-r--r--lib/api/jobs.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb
index a116ab3c9bd..57bad74c105 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -38,6 +38,7 @@ module API
builds = user_project.builds.order('id DESC')
builds = filter_builds(builds, params[:scope])
+ builds = builds.includes(:user, :job_artifacts_archive, :runner, pipeline: :project)
present paginate(builds), with: Entities::Job
end