Merging issue #216 (+ others) validation on Collection#create.

This commit is contained in:
Jeremy Ashkenas
2011-02-06 08:48:38 -05:00
parent 7442f826f1
commit 4c41ea7c7d

View File

@@ -511,9 +511,9 @@
var coll = this;
options || (options = {});
if (!(model instanceof Backbone.Model)) {
modelRef = model;
var attrs = model;
model = new this.model(null, {collection: coll});
if(!model.set(modelRef)) return false;
if (!model.set(attrs)) return false;
} else {
model.collection = coll;
}