Fix bug 1059900: Stop using sort_by! for ruby 1.8