comments: order by id, might be faster

This commit is contained in:
Carl Chenet 2017-05-23 10:30:02 +02:00
parent 69fc4dbab8
commit 2c7d00c100

View file

@ -231,7 +231,7 @@ class CommentsController < ApplicationController
@comments = Comment.where( @comments = Comment.where(
:is_deleted => false, :is_moderated => false :is_deleted => false, :is_moderated => false
).order( ).order(
"created_at DESC" "id DESC"
).offset( ).offset(
(@page - 1) * COMMENTS_PER_PAGE (@page - 1) * COMMENTS_PER_PAGE
).limit( ).limit(