Sorting for Rails projects