mxriverlynn / backbone.memento

store and restore your model's state
367 stars 51 forks source link

support for collections #4

Closed tbranyen closed 13 years ago

tbranyen commented 13 years ago

support for collections, contains tests, still need to use in production to see how this may break down.

tbranyen commented 13 years ago

Just wanna say that I tried this out in my current app and it worked flawlessly. So amazingly baller to filter collections :D

mxriverlynn commented 13 years ago

just read through the code - looks great! :) thank you for the attention to detail in updating the readme, especially.

one scenario popped into my mind that i didn't see covered in the specs, after reading through it: what happens when you remove a model from the collection and then restart? i would expect it to re-add that model to the collection. based on the way the collection .toJSON() is called to store the data, i would think that it works this way.

i'd like to see a spec that covers this scenario, whether or not it re-adds or leaves the removed model out.

tbranyen commented 13 years ago

If I'm understanding you correctly, yes, it definitely works that way. I'll create a test to mock that situation and add it in.

tbranyen commented 13 years ago

@derickbailey hope this test is what you were looking for.

mxriverlynn commented 13 years ago

exactly what i was hoping for! :)

i'll get this pulled in and have a new release out soon - tonight or tomorrow.

thanks for all the work on this!

mxriverlynn commented 13 years ago

finally got this merged and released!

tbranyen commented 13 years ago

Awesome! You're the man, glad I could contribute.