From: Go MAEDA Date: Sun, 27 Jun 2021 07:42:41 +0000 (+0000) Subject: Preload principal and roles in members#index (#35324). X-Git-Tag: 5.0.0~359 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2030323096eba687dbcf47b51adbf857a44f8695;p=redmine.git Preload principal and roles in members#index (#35324). Patch by Thomas Löber. git-svn-id: http://svn.redmine.org/redmine/trunk@21052 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 49e061799..2bfea7b22 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -33,7 +33,7 @@ class MembersController < ApplicationController @member_count = scope.count @member_pages = Paginator.new @member_count, @limit, params['page'] @offset ||= @member_pages.offset - @members = scope.order(:id).limit(@limit).offset(@offset).to_a + @members = scope.includes(:principal, :roles).order(:id).limit(@limit).offset(@offset).to_a respond_to do |format| format.html {head 406}