diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-14 23:13:18 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-01-14 23:14:11 +0100 |
commit | 87cc03736ccaa91db51e171883ef2e2a05a74360 (patch) | |
tree | f8d41dda86f9a44d080304d9bf044b0c8239e75d | |
parent | 091187962372673f0fa7c6f3a0e66cb14bc1b097 (diff) | |
download | gitlab-ce-87cc03736ccaa91db51e171883ef2e2a05a74360.tar.gz |
Fix N+1 builds query in Jobs list API
-rw-r--r-- | lib/api/jobs.rb | 1 |
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 |