Rails: Query to sort record by number except 0
问题 I'm arranging the data based on a priority(ascending order), where '0' ignored in prioritising. Below is the Rails Query: Profile.where(active: true).order(:priority).pluck(:priority) This query returns an ordered list of records with priorities that starts from '0' [0, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 7] Could you help me figure out how to order the data where the record with "0" is added to last in the query as per the example below. Example: [1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 7, 0]