creating a model should set its attribute

This commit is contained in:
Jeremy Ashkenas
2010-10-06 11:28:43 -04:00
parent 3190a5a7f4
commit c63f01ee12

View File

@@ -398,6 +398,7 @@
if (!(model instanceof Backbone.Model)) model = new this.model(model);
model.collection = this;
var success = function(model, resp) {
model.set(resp.model);
model.collection.add(model);
if (options.success) options.success(model, resp);
};