I have model named Group which has users_count field in it.
I have to order groups based upon dynamic preference of users_count like [3,4,2] means show groups with 3 users_count first, than with 4 and than with 2
Right now, I am using 3 separate queries and than merge records like
groups = Group.where(users_count: 3)
+ Group.where(users_count: 4)
+ Group.where(users_count: 2)
It works but It don't make sense to use 3 separate queries.
How can I achieve this in single query?