mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-23 05:48:10 -05:00
Merge pull request #503 from cdmwebs/master
Revert 495's behavior with tests
This commit is contained in:
@@ -342,7 +342,7 @@
|
||||
|
||||
// A model is new if it has never been saved to the server, and lacks an id.
|
||||
isNew : function() {
|
||||
return this[this.idAttribute] == null;
|
||||
return this.id == null;
|
||||
},
|
||||
|
||||
// Call this method to manually fire a `change` event for this model.
|
||||
|
||||
@@ -175,8 +175,10 @@ $(document).ready(function() {
|
||||
var model = new MongoModel({id: 'eye-dee', _id: 25, title: 'Model'});
|
||||
equals(model.get('id'), 'eye-dee');
|
||||
equals(model.id, 25);
|
||||
equals(model.isNew(), false);
|
||||
model.unset('_id');
|
||||
equals(model.id, undefined);
|
||||
equals(model.isNew(), true);
|
||||
});
|
||||
|
||||
test("Model: set an empty string", function() {
|
||||
|
||||
Reference in New Issue
Block a user