Make TraceController#list sort by id instead of timestamp

The effect is much the same but id is guaranteed to give a stable
sort if two traces have the same timestamp.
This commit is contained in:
Tom Hughes 2017-02-05 16:18:56 +00:00
parent 0814b4096c
commit 94ab5c3635

View file

@ -63,7 +63,7 @@ class TraceController < ApplicationController
@page_size = 20 @page_size = 20
@traces = @traces.visible @traces = @traces.visible
@traces = @traces.order("timestamp DESC") @traces = @traces.order(:id => :desc)
@traces = @traces.offset((@page - 1) * @page_size) @traces = @traces.offset((@page - 1) * @page_size)
@traces = @traces.limit(@page_size) @traces = @traces.limit(@page_size)
@traces = @traces.includes(:user, :tags) @traces = @traces.includes(:user, :tags)