summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-01-14 23:10:51 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-01-14 23:14:09 +0100
commitc9840842f181904e7a94946066bb5ca98c1f657a (patch)
tree0a0eb3127b5a94fe707a96061265f69502ce6f51 /lib
parentc9a1a1552a11a9ff862bf08df7267c553f2e0e99 (diff)
downloadgitlab-ce-c9840842f181904e7a94946066bb5ca98c1f657a.tar.gz
Eager load user, runner, pipeline and its creator
Diffstat (limited to 'lib')
-rw-r--r--lib/api/v3/builds.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/api/v3/builds.rb b/lib/api/v3/builds.rb
index a256a5720e1..7bf7329625c 100644
--- a/lib/api/v3/builds.rb
+++ b/lib/api/v3/builds.rb
@@ -35,7 +35,9 @@ module API
get ':id/builds' do
builds = user_project.builds.order('id DESC')
builds = filter_builds(builds, params[:scope])
- present paginate(builds.includes(:job_artifacts_archive)), with: ::API::V3::Entities::Build
+
+ builds = builds.includes(:user, :job_artifacts_archive, :runner, pipeline: :project)
+ present paginate(builds), with: ::API::V3::Entities::Build
end
desc 'Get builds for a specific commit of a project' do