From d99dbe9f0c55febbbfd980dc458856a543125ea6 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 31 Jul 2012 17:21:14 +0000 Subject: [PATCH] Eager loading and no extra count query. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10144 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/boards_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 3dea52bfb..cea2cd3bd 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -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 -- 2.39.5