Commit b25caf15 authored by Arturo Herrero's avatar Arturo Herrero

Use CTE optimization fence for :namespace/repos

parent da1f3335
......@@ -119,10 +119,12 @@ module API
projects = current_user.can_read_all_resources? ? Project.all : current_user.authorized_projects
projects = projects.in_namespace(namespace.self_and_descendants)
projects_cte = Project.wrap_authorized_projects_with_cte(projects)
.eager_load_namespace_and_owner
.with_route
present paginate(projects),
present paginate(projects_cte),
with: ::API::Github::Entities::Repository,
root_namespace: namespace.root_ancestor
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment