]> source.dussan.org Git - redmine.git/commitdiff
Preload principal and roles in members#index (#35324).
authorGo MAEDA <maeda@farend.jp>
Sun, 27 Jun 2021 07:42:41 +0000 (07:42 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 27 Jun 2021 07:42:41 +0000 (07:42 +0000)
Patch by Thomas Löber.

git-svn-id: http://svn.redmine.org/redmine/trunk@21052 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/members_controller.rb

index 49e06179970fc98871109757095210dc0ff4a443..2bfea7b22746334696afd366cdef9cc3c765adee 100644 (file)
@@ -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}