documentcloud/backbone — pull request #1587 by krawaller (2012-08-26 16:51:19+00:00)
Title: Allow model attribute name to be used as collection sort comparator value

This update edits Collection::sort to allow a model attribute name to be used as comparator. This facilitates the common use case where we just want to sort by an attribute value. Now, instead of having to provide an anonymous function just to make a get call on the model, we can simply send in a string with the name of the relevant attribute.

As an easy extra feature, the attribute name can be suffixed with "-" to make the sort descending.