jashkenas/backbone — pull request #3042 by caseywebdev (2014-03-05 12:21:15+00:00)
Title: Update polymorphic example

I think we should have been promoting this for polymorphic generation from the beginning, but better late than never. #2985 removed a hacky fallback here https://github.com/jashkenas/backbone/pull/2985/files#diff-0d56d0d310de7ff18b3cef9c2f8f75dcL687 that would assume your `model` factory function wanted the default `id` attribute. If you didn't want that default, you then were supposed to know to write `MyCollection.prototype.model.prototype.idAttribute = 'xxx'` which is kind of a crazy assumption. By encouraging this style for factories, you can see how trivial it is to change `idAttribute` or even `generateId` without having to add fallbacks in the code because the `model` actual acts like a `Model`.

I can add the fallback again if we want, but I think it should it should be removed in the future in favor of `model: Backbone.Model.extend({...}`.