Depends on what you want
Case.order("finished IS NOT NULL").order(due_date: :asc)
this line of code will ordered by due_date first than ordered by finished attribute,
so in front of the records you get will be record which finished is null.
Case.order(due_date: :asc).order("finished IS NOT NULL")
this line of code will ordered by finished attribute first than ordered by due_date,
so in front of the records you get will be record which due date is smaller.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…