mxriverlynn / backbone.picky

selectable entities as mixins for Backbone.Model and Backbone.Collection
129 stars 29 forks source link

Add support for a model which belongs to more than one collection. #16

Closed dakota closed 9 months ago

dakota commented 11 years ago

If a selectable model belongs to more than one selectable collection then only the initial collection will have it's select() method called.

Also, if a model is initially added to a non-selectable collection, and then later added to a selectable collection the 2nd collection will not have it's select() method called, and a error will be thrown as the initial collection will not have a select() method.

hashchange commented 10 years ago

I have worked on this a bit more and added full support for model sharing among collections. The edge cases should all be covered (I hope), as is the potential issue of memory leaks. There is a ton of tests, too, and the documentation is updated.