Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-11-20 03:46:40 +0300
committerFrancisco Lopez <fjlopez@gitlab.com>2017-12-01 20:32:12 +0300
commit0dfb8801012de19be006026a01d7db0f04a2d3b3 (patch)
tree381518591b8254aff1c50ad4e9ee45b92192d4d0 /lib/api/groups.rb
parent02cd1702b27ddb15f15f7efeb5ce60412492e41d (diff)
Preload project route to avoid N+1 query
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r--lib/api/groups.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 7e9a5502949..df2d97bceda 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -172,7 +172,7 @@ module API
get ":id/projects" do
group = find_group!(params[:id])
projects = GroupProjectsFinder.new(group: group, current_user: current_user, params: project_finder_params).execute
- projects = projects.preload(:fork_network, :forked_project_link, :project_feature, :project_group_links, :tags, :taggings, :group, :namespace)
+ projects = projects.preload(:fork_network, :forked_project_link, :project_feature, :project_group_links, :tags, :taggings, :group, :namespace, :route)
projects = reorder_projects(projects)
entity = params[:simple] ? Entities::BasicProjectDetails : Entities::Project
present paginate(projects), with: entity, current_user: current_user