diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-09-09 18:23:02 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-09-09 18:23:02 -0300 |
commit | 16bb9433f4534f85ac694b8645d13988af5051eb (patch) | |
tree | cab6db05569e6389762c32fec0b652794d6f3eb5 | |
parent | 58423fa8757726b4840d3b8db334212ed7c705a4 (diff) | |
download | gitlab-ce-16bb9433f4534f85ac694b8645d13988af5051eb.tar.gz |
Remove N+1 queries
-rw-r--r-- | app/controllers/projects/forks_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 4be4bd38367..aa02b86f537 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -16,7 +16,7 @@ class Projects::ForksController < Projects::ApplicationController @internal_forks_count = @total_forks_count - @public_forks_count - @private_forks_count @forks = ForkProjectsFinder.new(project, params: params.merge(search: params[:filter_projects]), current_user: current_user).execute - @forks = @forks.page(params[:page]) + @forks = @forks.eager_load_namespace_and_owner.includes(:creator).with_route.page(params[:page]) respond_to do |format| format.html |