mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-24 14:27:56 -05:00
Merging issue #216 (+ others) validation on Collection#create.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user