Commit c5f2ad713b466ec2bb6d2720e215ad2f26c337fc
Exists in
master
and in
1 other branch
Merge pull request #427 from iFixit/tally-fix-sort-order
Tally: correct the sort order
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,7 +57,7 @@ module ApplicationHelper | ||
57 | total = (options[:total] || total_from_tallies(tallies)) | 57 | total = (options[:total] || total_from_tallies(tallies)) |
58 | percent = 100.0 / total.to_f | 58 | percent = 100.0 / total.to_f |
59 | rows = tallies.map {|value, count| [(count.to_f * percent), value]} \ | 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 | render "problems/tally_table", :rows => rows | 61 | render "problems/tally_table", :rows => rows |
62 | end | 62 | end |
63 | 63 |