From 6a39bfd8f32cfa84da2855e1e16fb015669f9cef Mon Sep 17 00:00:00 2001 From: David Marble Date: Wed, 13 Jun 2012 14:52:42 -0400 Subject: [PATCH] Move collection assignment a few lines up so this.collection is available in Model.parse --- backbone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backbone.js b/backbone.js index 9a8f2571..afabb313 100644 --- a/backbone.js +++ b/backbone.js @@ -178,11 +178,11 @@ var Model = Backbone.Model = function(attributes, options) { var defaults; attributes || (attributes = {}); + if (options && options.collection) this.collection = options.collection; if (options && options.parse) attributes = this.parse(attributes); if (defaults = getValue(this, 'defaults')) { attributes = _.extend({}, defaults, attributes); } - if (options && options.collection) this.collection = options.collection; this.attributes = {}; this._escapedAttributes = {}; this.cid = _.uniqueId('c');