Permalink
Browse files

Merge branch 'master' of github.com:mde/model

  • Loading branch information...
2 parents 0804d40 + c42b13f commit b4561b176390804ed243cf7091b716d72dec1a6e mde committed Oct 20, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/index.js
  2. +1 −1 package.json
View
@@ -645,11 +645,13 @@ utils.mixin(model, new (function () {
// contains an Object literal keyed by field name, and the
// error message for the first failed validation for that
// property
+ // Use raw, invalid value on the instance
if (validated.err) {
errs = errs || {};
errs[p] = validated.err;
+ item[p] = params[p];
}
- // Otherwise add this property to the return item
+ // Otherwise add the type-coerced, valid value to the return item
else {
item[p] = validated.val;
}
View
@@ -14,7 +14,7 @@
"mongo",
"mongodb"
],
- "version": "0.0.12",
+ "version": "0.0.13",
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
"main": "./lib/index.js",
"scripts": {

0 comments on commit b4561b1

Please sign in to comment.