Skip to content

Commit

Permalink
Maybe it will be more accurate because models can have "0" as an id
Browse files Browse the repository at this point in the history
  • Loading branch information
igoralekseev committed Oct 21, 2011
1 parent 1607075 commit a70df22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backbone.localStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Backbone.sync = function(method, model, options, error) {
var store = model.localStorage || model.collection.localStorage;

switch (method) {
case "read": resp = model.id ? store.find(model) : store.findAll(); break;
case "read": resp = model.id != undefined ? store.find(model) : store.findAll(); break;
case "create": resp = store.create(model); break;
case "update": resp = store.update(model); break;
case "delete": resp = store.destroy(model); break;
Expand Down

0 comments on commit a70df22

Please sign in to comment.