From c9840842f181904e7a94946066bb5ca98c1f657a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Sun, 14 Jan 2018 23:10:51 +0100 Subject: Eager load user, runner, pipeline and its creator --- lib/api/v3/builds.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/api/v3') 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 -- cgit v1.2.1