Replaces find(:all) calls.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10914 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-12-02 19:09:42 +00:00
parent 1951c6a3fd
commit 5b21efd4a4
10 changed files with 29 additions and 26 deletions

View File

@@ -40,10 +40,12 @@ class MessagesController < ApplicationController
@reply_count = @topic.children.count
@reply_pages = Paginator.new self, @reply_count, REPLIES_PER_PAGE, page
@replies = @topic.children.find(:all, :include => [:author, :attachments, {:board => :project}],
:order => "#{Message.table_name}.created_on ASC",
:limit => @reply_pages.items_per_page,
:offset => @reply_pages.current.offset)
@replies = @topic.children.
includes(:author, :attachments, {:board => :project}).
reorder("#{Message.table_name}.created_on ASC").
limit(@reply_pages.items_per_page).
offset(@reply_pages.current.offset).
all
@reply = Message.new(:subject => "RE: #{@message.subject}")
render :action => "show", :layout => false if request.xhr?