Eager loading and no extra count query.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10144 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-07-31 17:21:14 +00:00
parent 3f88fd44ef
commit d99dbe9f0c
1 changed files with 1 additions and 1 deletions

View File

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