nodee-model
Advanced tools
Comparing version 0.9.2 to 0.9.3
@@ -123,3 +123,3 @@ 'use strict'; | ||
doc.constructor.collection().findId(doc.ancestors).fields({ id:true }).all(function(err, ancs){ | ||
doc.constructor.collection().findId(doc.ancestors).fields({ id:true, ancestors:true }).all(function(err, ancs){ | ||
if(err) cb(new Error((doc.constructor._name||'Tree')+'.prototype.validateAncestors: cannot get ancestors').cause(err)); | ||
@@ -133,4 +133,3 @@ else if(ancs.length !== newPath.length) cb(new Error((doc.constructor._name||'Tree')+'.prototype.validateAncestors: cannot find all ancestors').details({ code:'EXECFAIL' })); | ||
if(parentPathLength > -1 && parentPathLength + 1 !== ancs[a].ancestors.length) { | ||
cb(new Error((doc.constructor._name||'Tree')+'.prototype.validateAncestors: inconsistent path')); | ||
return; | ||
return cb(new Error((doc.constructor._name||'Tree')+'.prototype.validateAncestors: inconsistent tree path')); | ||
} | ||
@@ -137,0 +136,0 @@ // TODO: check ancestors order consistency |
@@ -95,3 +95,3 @@ 'use strict'; | ||
return cleanObject; | ||
} | ||
}; | ||
@@ -98,0 +98,0 @@ |
{ | ||
"name": "nodee-model", | ||
"preferGlobal": false, | ||
"version": "0.9.2", | ||
"version": "0.9.3", | ||
"author": "NODEE - Matus Szabo <matus@nodee.io>", | ||
@@ -6,0 +6,0 @@ "description": "Advanced, database agnostic ODM", |
229509
4914