jashkenas/backbone — pull request #3034 by braddunbar (2014-03-03 16:45:15+00:00)
Title: Allow customization of parsing id.

An alternative to #2985.

Rather than handling composite ids specifically, I think it best that we just allow customizing the method by which the id is parsed. Then you can do the same in `Model#parse` and set up whatever change handlers you need on your own, thus leaving `_onModelChange` to worry about one change event, the already existing `change:id`.

```js
var Collection = Backbone.Collection.extend({
model: Backbone.Model.extend({
parse: function(attrs) {
attrs.id = attrs.one + attrs.two;
return attrs;
}
}),
parseId: function(attrs) {
return attrs.one + attrs.two;
}
});
```