Let's say I have an array called surveys
that's made up of Survey.all
Each survey model has a length
and cost
columns.
What's the best way to sort an array first on length
, and then on cost
.
I basically want to do something similar to Survey.all.order(length: :desc, cost: :asc)
but on the array after it's created.