projects
/
rails.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0814b40
)
Make TraceController#list sort by id instead of timestamp
author
Tom Hughes
<tom@compton.nu>
Sun, 5 Feb 2017 16:18:56 +0000
(16:18 +0000)
committer
Tom Hughes
<tom@compton.nu>
Sun, 5 Feb 2017 16:18:56 +0000
(16:18 +0000)
The effect is much the same but id is guaranteed to give a stable
sort if two traces have the same timestamp.
app/controllers/trace_controller.rb
patch
|
blob
|
history
diff --git
a/app/controllers/trace_controller.rb
b/app/controllers/trace_controller.rb
index b7c9ccd70061357f324af38446c84b53b89afa65..f3fa81fd8e2fdeecf9075991dcf9bbc077e77836 100644
(file)
--- a/
app/controllers/trace_controller.rb
+++ b/
app/controllers/trace_controller.rb
@@
-63,7
+63,7
@@
class TraceController < ApplicationController
@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)