Changes for deprecated activerecord ordering style.