This is my input hash:
h = [
{user_id: 1, bookings_nd: 3},
{user_id: 2, bookings_nd: 10},
{user_id: 3, bookings_nd: 2}
]
I need the result to be sorted in descending order of 'bookings_nd' rather than 'user_id'. I want it to look like this:
h = [
{user_id: 2, bookings_nd: 10},
{user_id: 1, bookings_nd: 3},
{user_id: 3, bookings_nd: 2}
]
How to do it?