Skip to content

Commit

Permalink
Fix: model with required field that defaults to false can't be saved
Browse files Browse the repository at this point in the history
Boolean variant of commit d28bacc.
  • Loading branch information
jyrkive committed Sep 26, 2017
1 parent d28bacc commit 12de7af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fields/types/boolean/BooleanType.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ boolean.prototype.validateInput = function (data, callback) {

boolean.prototype.validateRequiredInput = function (item, data, callback) {
var value = this.getValueFromData(data);
var result = (value && value !== 'false') || item.get(this.path) ? true : false;
var result = (value && value !== 'false') || typeof item.get(this.path) === 'boolean' ? true : false;
utils.defer(callback, result);
};

Expand Down

0 comments on commit 12de7af

Please sign in to comment.