summaryrefslogtreecommitdiff
path: root/lib/api/jobs.rb
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-15 22:04:08 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-01-15 22:04:08 +0100
commitfeb3449709ce4fce62227f67233bc4d061c66ab5 (patch)
tree84484b257e2e73a6e2bc0f620884ac5373505188 /lib/api/jobs.rb
parent8cef1f4cf169409cbc9d8e635c78284c2b3b037c (diff)
downloadgitlab-ce-feb3449709ce4fce62227f67233bc4d061c66ab5.tar.gz
Use preload instead of includes to avoid joinsbuilds-api-nplusone
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 57bad74c105..9c205514b3a 100644
--- a/lib/api/jobs.rb
+++ b/lib/api/jobs.rb
@@ -38,7 +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)
+ builds = builds.preload(:user, :job_artifacts_archive, :runner, pipeline: :project)
present paginate(builds), with: Entities::Job
end