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

You need to sign in or sign up before continuing.
Commit ef0e8bb5 by Mick Hansen

boolean undefined values should not be converted to false

1 parent 7d414335
Showing with 2 additions and 2 deletions
...@@ -161,7 +161,7 @@ module.exports = (function() { ...@@ -161,7 +161,7 @@ module.exports = (function() {
} }
// Convert boolean-ish values to booleans // Convert boolean-ish values to booleans
if (this._hasBooleanAttributes && this._isBooleanAttribute(key) && value !== null) { if (this._hasBooleanAttributes && this._isBooleanAttribute(key) && value !== null && value !== undefined) {
value = !!value value = !!value
} }
......
...@@ -1289,7 +1289,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () { ...@@ -1289,7 +1289,7 @@ describe(Support.getTestDialectTeaser("DAO"), function () {
}) })
}) })
}) })
it("returns null for null, undefined, and unset boolean values", function(done) { it.only("returns null for null, undefined, and unset boolean values", function(done) {
var Setting = this.sequelize.define('SettingHelper', { var Setting = this.sequelize.define('SettingHelper', {
setting_key: DataTypes.STRING, setting_key: DataTypes.STRING,
bool_value: { type: DataTypes.BOOLEAN, allowNull: true }, bool_value: { type: DataTypes.BOOLEAN, allowNull: true },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!