Permalink
Browse files

fix(lib/yukari.js): fix the bug: null is not equl to false(or 0, )

  • Loading branch information...
mapleincode committed Mar 10, 2016
1 parent b599506 commit 6fd7c12d443e25fa33e04682a15b669a41832135
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/yukari.js
@@ -426,6 +426,17 @@ Yukari.prototype.update = function(callback) {
fieldType.$equal.bind(fieldType) :
field.type.equal.bind(field.type));

// null not equal to false or 0 or ''
if((null === this[key] || null === this.$origData[key].data) &&
this[key] !== this.$origData[key].data &&
field.allowNull) {
data[field.name] = {
data : this[key],
field : field
};
continue;
}

// only change changed data
if(!equalFunc(this[key], this.$origData[key].data)) {
data[field.name] = {

0 comments on commit 6fd7c12

Please sign in to comment.