updated mysql adapter to support boolean definition

updated mysql adapter to treat boolean type fields like in rails, it
means that boolean values will be converted to integer(1 for true and 0
for false) values
This commit is contained in:
redvulps 2011-11-19 15:16:37 -02:00
parent abde0df35b
commit f51990949f
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ MySQL.prototype.toDatabase = function (prop, val) {
].join('-'); ].join('-');
return this.client.escape(val); return this.client.escape(val);
} }
if (prop.type.name == "Boolean") return val ? 1 : 0;
return this.client.escape(val.toString()); return this.client.escape(val.toString());
}; };