Permalink
Browse files

fix setting of id for todo model

  • Loading branch information...
1 parent 1bd9b7c commit f71bc0d53bd7de0d540dd7dac5eb49a8daf68c73 @ymichael ymichael committed Apr 6, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 examples/backbone-localstorage.js
@@ -30,7 +30,7 @@ _.extend(Store.prototype, {
// Add a model, giving it a (hopefully)-unique GUID, if it doesn't already
// have an id of it's own.
create: function(model) {
- if (!model.id) model.id = model.attributes.id = guid();
+ if (!model.id) model.set(model.idAttribute, guid());
this.data[model.id] = model;
this.save();
return model;

0 comments on commit f71bc0d

Please sign in to comment.