Inverse order for list of type of swaps

This commit is contained in:
Patri
2014-07-09 20:51:04 +02:00
parent 94f1e26946
commit 790a4d5c05
+1 -1
View File
@@ -102,7 +102,7 @@ class ReportsController < ApplicationController
end
end
total_swaps = @offers_by_tag.map{|k,v| v[:swaps]}.inject(0.0,:+)
@offers_by_tag = @offers_by_tag.each{|k,v| v[:percent] = v[:swaps]/total_swaps*100}.sort_by{|k,v| v[:percent]}
@offers_by_tag = @offers_by_tag.each{|k,v| v[:percent] = v[:swaps]/total_swaps*100}.sort_by{|k,v| v[:percent]}.reverse
end
end