order by id instead of created_at

id is indexed while created_at is not
This commit is contained in:
jomo
2017-07-07 01:57:30 +02:00
parent 4e1b6b430b
commit 72a6dcc54a
4 changed files with 5 additions and 5 deletions

View File

@@ -12,9 +12,9 @@ class ForumthreadsController < ApplicationController
end
def show
if params[:reverse] == "true"
@replies = @thread.replies.order(created_at: :desc).page(params[:page])
@replies = @thread.replies.order(id: :desc).page(params[:page])
else
@replies = @thread.replies.order(:created_at).page(params[:page])
@replies = @thread.replies.order(:id).page(params[:page])
end
end