I am new to rails. how to sort total leads in my array of hash. total leads maximum values should be first.
Array = [
{
"project_name"=>"Godrej United",
"lead_stats"=>{
"total_leads"=>1,
"untouched_leads"=>0,
"dumped_leads"=>1,
"not_responding"=>0,
"switched_off"=>0,
"hot_leads"=>1,
"cold_leads"=>1,
"warm_leads"=>0
},
"project_id"=>2
},
{
"project_name"=>"Golden Panorama",
"lead_stats"=>{
"total_leads"=>5,
"untouched_leads"=>0,
"dumped_leads"=>1,
"not_responding"=>0,
"switched_off"=>0,
"hot_leads"=>0,
"cold_leads"=>0,
"warm_leads"=>0
},
"project_id"=>10
}
]