Skip to content

Commit

Permalink
Merge pull request jashkenas#2878 from blakeembrey/has-fix
Browse files Browse the repository at this point in the history
Make isNew use the has function
  • Loading branch information
jashkenas committed Nov 16, 2013
2 parents cc3721a + 6dcec29 commit 926756c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@

// A model is new if it has never been saved to the server, and lacks an id.
isNew: function() {
return this.id == null;
return !this.has(this.idAttribute);
},

// Check if the model is currently in a valid state.
Expand Down

0 comments on commit 926756c

Please sign in to comment.