I have a collection of objects @users, each having its id attribute.
@users = [#<User id:1>, #<User id:2>]
I also have an ordered Array of ids.
ids = [2,1]
¿Is there a magical way to sort the collection using that list of ids? Without making another call to the database, if possible.
Thank you !!!