alekseykulikov / backbone-offline

[Deprecated] Allows your Backbone.js app to work offline
MIT License
720 stars 56 forks source link

Fetch Local dont work with Backbone 1.0 #39

Closed kprimdal closed 11 years ago

kprimdal commented 11 years ago

I just updated to Version 1.0 of Backbone and then fetch({local: true}) does not work anymore.

When running that command, if just add a new instance of the Collection in the collection.

alekseykulikov commented 11 years ago

Hi @kprimdal, I've not tested backbone.offline with Backbone 1.0 yet, need to try.

spencernowak commented 11 years ago

Found the issue on line 27 of the JS file: return options.success(model, (_ref = resp.attributes) != null ? _ref : resp, options);

BB 1.0 expects the response as the first argument. Change the line to: return options.success((_ref = resp.attributes) != null ? _ref : resp, options); and it will stop nesting another collection on local fetch.

kprimdal commented 11 years ago

Great work @spencernowak, thanks for letting us know

alekseykulikov commented 11 years ago

Done. New 0.5.0 version supports only Backbone 1.0.0.