Skip to content

Commit

Permalink
Make TraceController#list sort by id instead of timestamp
Browse files Browse the repository at this point in the history
The effect is much the same but id is guaranteed to give a stable
sort if two traces have the same timestamp.
  • Loading branch information
tomhughes committed Feb 5, 2017
1 parent 0814b40 commit 94ab5c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/trace_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def list
@page_size = 20

@traces = @traces.visible
@traces = @traces.order("timestamp DESC")
@traces = @traces.order(:id => :desc)
@traces = @traces.offset((@page - 1) * @page_size)
@traces = @traces.limit(@page_size)
@traces = @traces.includes(:user, :tags)
Expand Down

0 comments on commit 94ab5c3

Please sign in to comment.