mirror of
https://github.com/jashkenas/backbone.git
synced 2026-01-22 13:28:22 -05:00
Move collection assignment a few lines up so this.collection is available in Model.parse
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user