In rails application I want to sort task by priority, the priority have the value p1,p2,p3,nil. If I sort like this
task..order(:priority).each do |t|
The task which have nil as priority comes first, then other things are sorted based on order. I want task which have nil priority to go last on loop. How to accomplish this one?
I am using mysql db