From 2f320a6c8755e78bedfeebf7b02f1123e84c9560 Mon Sep 17 00:00:00 2001 From: Bramboos Date: Sun, 15 Feb 2015 19:13:44 +0100 Subject: [PATCH 1/3] Undefined data value = not set -> skip to defaultValue --- lib/Instance.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Instance.js b/lib/Instance.js index 9670ddc4..e59df3d8 100755 --- a/lib/Instance.js +++ b/lib/Instance.js @@ -480,8 +480,9 @@ function Instance(Model, opts) { // Its presence doesn't affect tests, so I'm just gonna log if it ever gets called. // If someone complains about noise, we know it does something, and figure it out then. if (instance.hasOwnProperty(key)) console.log("Overwriting instance property"); - - if (key in opts.data) { + + //Undefined data values are not setted so skip to defaultvalue + if (opts.data[key] != undefined) { defaultValue = opts.data[key]; } else if (prop && 'defaultValue' in prop) { defaultValue = prop.defaultValue; From c837400a7f8f91b4346859d392aaabba769f194c Mon Sep 17 00:00:00 2001 From: Bramboos Date: Sun, 15 Feb 2015 19:14:43 +0100 Subject: [PATCH 2/3] Deleted node 0.6 version from Readme --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index fd6942b4..b5c7f471 100755 --- a/Readme.md +++ b/Readme.md @@ -13,7 +13,7 @@ npm install orm ## Node.js Version Support -Tests are done using [Travis CI](https://travis-ci.org/) for node versions `0.6.x`, `0.8.x` and `0.10.x`. If you want you can run +Tests are done using [Travis CI](https://travis-ci.org/) for node versions `0.8.x` and `0.10.x`. If you want you can run tests locally. ```sh From 96bfd69fa22dbef8eeb2e50913939d425b97f8f1 Mon Sep 17 00:00:00 2001 From: Bramboos Date: Sun, 15 Feb 2015 19:24:20 +0100 Subject: [PATCH 3/3] Forgotten '=' --- lib/Instance.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Instance.js b/lib/Instance.js index e59df3d8..8cbb9447 100755 --- a/lib/Instance.js +++ b/lib/Instance.js @@ -480,9 +480,9 @@ function Instance(Model, opts) { // Its presence doesn't affect tests, so I'm just gonna log if it ever gets called. // If someone complains about noise, we know it does something, and figure it out then. if (instance.hasOwnProperty(key)) console.log("Overwriting instance property"); - + //Undefined data values are not setted so skip to defaultvalue - if (opts.data[key] != undefined) { + if (opts.data[key] !== undefined) { defaultValue = opts.data[key]; } else if (prop && 'defaultValue' in prop) { defaultValue = prop.defaultValue;