[Pkg-javascript-commits] [backbone] 199/281: Fixes #593 -- pass complete options to model constructor on create()
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:02:12 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.9.0
in repository backbone.
commit 3f0979f09a49615a8b1bfb08469fc42dda1c4a5f
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Fri Jan 13 16:56:12 2012 -0500
Fixes #593 -- pass complete options to model constructor on create()
---
backbone.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/backbone.js b/backbone.js
index c5d6796..cd2e9c4 100644
--- a/backbone.js
+++ b/backbone.js
@@ -596,7 +596,8 @@
_prepareModel : function(model, options) {
if (!(model instanceof Backbone.Model)) {
var attrs = model;
- model = new this.model(attrs, {collection: this, parse: options.parse});
+ options.collection = this;
+ model = new this.model(attrs, options);
if (model.validate && !model._performValidation(model.attributes, options)) model = false;
} else if (!model.collection) {
model.collection = this;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list