#1082: Remove secondary id sorting, allowing index to be used

Related to #1140
This commit is contained in:
Toks
2013-12-24 19:42:08 -05:00
parent 659e0b9457
commit 79ecd55b57

View File

@@ -78,7 +78,7 @@ private
end
def index_by_post
@posts = Post.commented_before(Time.now).tag_match(params[:tags]).paginate(params[:page], :limit => 5, :search_count => params[:search])
@posts = Post.where("last_commented_at IS NOT NULL").tag_match(params[:tags]).reorder("last_commented_at DESC").paginate(params[:page], :limit => 5, :search_count => params[:search])
@posts.all
respond_with(@posts) do |format|
format.html {render :action => "index_by_post"}