Hi,
I have this array of record ids of a table. ids = [110, 113, 103, 102, 116, 118, 112, 115, 170, 121, 119, 1, 3, 16, 12, 13, 9, 15, 169, 21, 18, 14]
When I pass this array to a find method like Task.find(ids), the finder sorts the active record objects based on the id. So I get back records in the order of [1, 3, 9, 12, 13, 14, 15, 16, 18, 21, 102, 103, 110, 112, 113, 115, 116, 118, 119, 121, 169, 170] which is sorted by the record id.
But I don't want to disturb the order. I just want AR to return the records in the same order as my input array. How can I achieve this?
Thanks much. -subbu