I've an array priority = ['HIGH', 'MEDIUM', 'LOW'] which is used to set an 'urgency' database column. I'd like to retrieve the data sorted by priority, though applying Task.order(:urgency) returns the results alphabetically (i.e. HIGH, LOW, MEDIUM).
I'm using PostgreSQL for the database.
I'd (obviously) like these to return from high to low priority. Is there a simple way to implement this, perhaps using the values' positions in the array?