mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user