Cleanup of finders with :conditions option.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11963 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -35,7 +35,7 @@ class MessagesController < ApplicationController
|
||||
page = params[:page]
|
||||
# Find the page of the requested reply
|
||||
if params[:r] && page.nil?
|
||||
offset = @topic.children.count(:conditions => ["#{Message.table_name}.id < ?", params[:r].to_i])
|
||||
offset = @topic.children.where("#{Message.table_name}.id < ?", params[:r].to_i).count
|
||||
page = 1 + offset / REPLIES_PER_PAGE
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user