]> source.dussan.org Git - redmine.git/commitdiff
Eager loading and no extra count query.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 31 Jul 2012 17:21:14 +0000 (17:21 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 31 Jul 2012 17:21:14 +0000 (17:21 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10144 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/boards_controller.rb

index 3dea52bfbe38ddbb26a3cc34f64065cb2b19b39d..cea2cd3bdc00c673c8fc11cfaee8de68a6f5f20b 100644 (file)
@@ -25,7 +25,7 @@ class BoardsController < ApplicationController
   helper :watchers
 
   def index
-    @boards = @project.boards
+    @boards = @project.boards.includes(:last_message => :author).all
     # show the board if there is only one
     if @boards.size == 1
       @board = @boards.first