Explicitly stated order of threadreplies

This commit is contained in:
MrYummy
2017-07-04 09:23:01 -04:00
committed by GitHub
parent 9b64c2c6d9
commit f90257fe73

View File

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