I would like to start sorting all my results by a new field. Unfortunately, a lot of my older fields have a nil for a timestamp. How can I perform this method and put all the nils in the back?
.sort{|a,b| b.offering_referral_timestamp <=> a.offering_referral_timestamp}
Thanks
so I think this should work (if you want all nil at the end, they should be bigger than other elements):