I think you should use fragments with respect to this stackoverflow answer:
order_by: [
desc_nulls_last: r.percent,
asc: applicant.name,
asc: fragment("case when ? then 1 when ? is null then 2 else 3 end", applicant.boolean_field, applicant.boolean_field)
]
desc? Assuming you have no nulls, since you didn’t mention what to do with them–normal order is false then true, that’s PG’s idea of “ascending” for this data type, so to reverse it just use desc: