From 4c41ea7c7d7cd93f3456e632d8aa612f28ea3fca Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Sun, 6 Feb 2011 08:48:38 -0500 Subject: [PATCH] Merging issue #216 (+ others) validation on Collection#create. --- backbone.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backbone.js b/backbone.js index 60747dab..2d5461b0 100644 --- a/backbone.js +++ b/backbone.js @@ -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; }