From fb8da91e3e44e95df416e5ecee5926549bfe0abb Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 26 May 2011 15:49:16 -0400 Subject: [PATCH] merging in #336. --- backbone.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backbone.js b/backbone.js index c2e56189..e88c8293 100644 --- a/backbone.js +++ b/backbone.js @@ -563,13 +563,12 @@ var attrs = model; model = new this.model(null, {collection: this}); if (!model.set(attrs, options)) model = false; - } - else if (!model.collection) { + } else if (!model.collection) { model.collection = this; } return model; }, - + // Internal implementation of adding a single model to the set, updating // hash indexes for `id` and `cid` lookups. // Returns the model, or 'false' if validation on a new model fails.