@cases => [{"name"=>"25 Cases per 60 day", "count"=>0},
{"name"=>"30 Cases for 60 days", "count"=>8},
{"name"=>"10 Cases per 60 days", "count"=>5}]
If I have an object which contains the previous results how can I sort by count
in DESC order?
To get the instance variable cases
I did
ClassName.all.collect{|e| {'name' => e.name, 'count' => e.contracts.count}}