I'm using postgres DB & I have an array of product ids: [5, 4, 1, 2]
then I invoked
products = Product.where(:id => ids)
Now result products sort after invoking products.map(&:id) is [4, 1, 2, 5]
How can I sort the products using same sort of ids array?