Comparing version 1.0.5 to 1.0.6
1.0.6 / 2011-02-03 | ||
================== | ||
* Fixed `post` middleware | ||
* Fixed; it's now possible to instantiate a model even when one of the paths maps | ||
to an undefined value [brian] | ||
1.0.5 / 2011-02-02 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -136,2 +136,4 @@ | ||
this.emit('init'); | ||
return this; | ||
@@ -186,2 +188,3 @@ }; | ||
if (!(this.schema.path(prefix + i) instanceof MixedSchema) | ||
&& 'undefined' !== typeof path[i] | ||
&& path[i] !== null | ||
@@ -188,0 +191,0 @@ && path[i].constructor == Object) { |
@@ -256,3 +256,3 @@ | ||
exports.version = '1.0.5'; | ||
exports.version = '1.0.6'; | ||
@@ -259,0 +259,0 @@ /** |
@@ -65,4 +65,18 @@ | ||
Model.prototype.save = function (fn) { | ||
var options = {}; | ||
var promise = new Promise() | ||
, options = {} | ||
, self = this; | ||
// add callback+errback | ||
promise.addBack(function (err) { | ||
if (err) return fn(err); | ||
fn(null); | ||
self.emit('save'); | ||
}); | ||
function complete (err) { | ||
if (err) return promise.error(err); | ||
promise.complete(); | ||
}; | ||
// support for safe mode | ||
@@ -74,3 +88,3 @@ if (this.options.safe) | ||
// send entire doc | ||
this.collection.insert(this.toObject(), options, fn); | ||
this.collection.insert(this.toObject(), options, complete); | ||
this.isNew = false; | ||
@@ -162,5 +176,5 @@ } else { | ||
if (Object.keys(delta).length) | ||
this.collection.update({ _id: this.doc._id }, delta, options, fn); | ||
this.collection.update({ _id: this.doc._id }, delta, options, complete); | ||
else | ||
fn(null); | ||
complete(null); | ||
// TODO Clear 'modify'('dirty') cache | ||
@@ -167,0 +181,0 @@ } |
{ | ||
"name": "mongoose" | ||
, "description": "Mongoose MongoDB ORM" | ||
, "version": "1.0.5" | ||
, "version": "1.0.6" | ||
, "author": "Guillermo Rauch <guillermo@learnboost.com>" | ||
@@ -6,0 +6,0 @@ , "keywords": ["mongodb", "mongoose", "orm", "data", "datastore", "nosql"] |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1658327
28569