Duplicating data? #31

Closed
omarshal opened this Issue May 11, 2012 · 2 comments

Comments

Projects
None yet
2 participants

Hi,

I'm not sure if this is an issue or just I don't know how to use the library properly:

I've created an stack overflow question about this:

http://stackoverflow.com/questions/10549056/duplication-localstorage-data-using-backbone-js-backbone-localstorage-js

Basically I create a model, and when I do the fetch() after the save() I get the data in a different way, stored inside a nested object instead of getting it at attributes property level....

Edit: It looks I'm not the first with this issue:

http://stackoverflow.com/questions/10326690/backbone-js-trouble-persisting-simple-model-to-localstorage
http://stackoverflow.com/questions/7544503/backbone-js-saving-one-model-in-local-storage

The workaround to this issue is to specify a constant ID for each instance of the model. This way you can save and fetch it properly

Owner

jeromegn commented May 18, 2012

This wasn't originally intended to be used for models. Though it does make sense that it would work with them. I'm not sure how this was overseen. Probably because I don't personally use the project anymore.

I'd like to take a day or so to get the tests right and the implementation complete. I'm lost on how well or unwell this is working right now since I haven't used it in years.

jeromegn closed this Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment