I am trying to do a "ORDER BY FIELD"
in active record. I know that i can do it with MySQL
but i am trying to keep my app agnostic and follow best practice. my production db is PostgreSQL
the MySQL looks like
SELECT id, name
FROM mytable
WHERE name IN ('B', 'A', 'D', 'E', 'C')
ORDER BY FIELD(name, 'B', 'A', 'D', 'E', 'C')