From f59cf0ddbf1f51a117f053806bd92aaad0103891 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Sat, 13 Oct 2012 19:19:53 +0400 Subject: [PATCH] Specify collection length --- .travis.yml | 2 +- lib/abstract-class.js | 1 + lib/validatable.js | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e17614b..195a70e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: node_js node_js: - 0.4.12 - 0.6 - - 0.8.9 + - 0.8.11 services: - mongodb - redis-server diff --git a/lib/abstract-class.js b/lib/abstract-class.js index e82329f5..1c89d36d 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -340,6 +340,7 @@ AbstractClass.all = function all(params, cb) { if (data && data.countBeforeLimit) { collection.countBeforeLimit = data.countBeforeLimit; } + collection.length = data.length; cb(err, collection); } else diff --git a/lib/validatable.js b/lib/validatable.js index 13679ec7..f9b9bb52 100644 --- a/lib/validatable.js +++ b/lib/validatable.js @@ -420,7 +420,6 @@ function validationFailed(inst, v, cb) { } function skipValidation(inst, conf, kind) { - console.log(conf, kind, inst.hasOwnProperty(conf[kind]), inst[conf[kind]]); var doValidate = true; if (typeof conf[kind] === 'function') { doValidate = conf[kind].call(inst);