From: Jean-Philippe Lang Date: Tue, 31 Jul 2012 17:21:14 +0000 (+0000) Subject: Eager loading and no extra count query. X-Git-Tag: 2.1.0~182 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d99dbe9f0c55febbbfd980dc458856a543125ea6;p=redmine.git Eager loading and no extra count query. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10144 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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