[Pkg-javascript-commits] [backbone] 207/211: slightly saner validation on initialize.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.0
in repository backbone.

commit ddf1a833abaf8bb6aeb5d488a7a24a3ca4577006
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Fri Jul 1 11:49:19 2011 -0400

    slightly saner validation on initialize.
---
 backbone.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backbone.js b/backbone.js
index 09cb4b7..5f8ea5c 100644
--- a/backbone.js
+++ b/backbone.js
@@ -566,8 +566,8 @@
     _prepareModel: function(model, options) {
       if (!(model instanceof Backbone.Model)) {
         var attrs = model;
-        model = new this.model(null, {collection: this});
-        if (!model.set(attrs, options)) model = false;
+        model = new this.model(attrs, {collection: this});
+        if (model.validate && !model._performValidation(attrs, 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