Commit ab5b8375c2a9c696c909ca21179e5b5480cc3b43
1 parent
5f71dcd7
Exists in
master
and in
1 other branch
Tally: correct the sort order
Alter tally sort order to be by popularity descending instead of ascending. Because we should show the most popular entries at the top.
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/helpers/application_helper.rb
... | ... | @@ -57,7 +57,7 @@ module ApplicationHelper |
57 | 57 | total = (options[:total] || total_from_tallies(tallies)) |
58 | 58 | percent = 100.0 / total.to_f |
59 | 59 | rows = tallies.map {|value, count| [(count.to_f * percent), value]} \ |
60 | - .sort {|a, b| a[0] <=> b[0]} | |
60 | + .sort {|a, b| b[0] <=> a[0]} | |
61 | 61 | render "problems/tally_table", :rows => rows |
62 | 62 | end |
63 | 63 | ... | ... |