不要怂,就是干,撸起袖子干!

Commit 7ffacfe2 by sdepold

improved logic

1 parent 35ee7d89
Showing with 2 additions and 2 deletions
......@@ -155,8 +155,8 @@ module.exports = (function() {
Utils._.each(this.attributes, function(definition, name) {
//transform integer 0,1 into boolean
if(definition.indexOf(DataTypes.BOOLEAN) !== -1 && typeof instance[name] === "number") {
instance[name] = (instance[name] === 0) ? false : true;
if((definition.indexOf(DataTypes.BOOLEAN) !== -1) && (typeof instance[name] === "number")) {
instance[name] = (instance[name] !== 0)
}
//add default attributes
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!