Slightly improved logic Add support for relations more than one 'level' apart Add unit tests Fixing PostgreSQL support Throw exception if attempting to sort on a has_many/many_many relation