diff --git a/lib/abstract-class.js b/lib/abstract-class.js index 78cbee30..a877399b 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -308,7 +308,6 @@ AbstractClass.prototype.propertyChanged = function (attr) { return this['_' + attr] !== this[attr + '_was']; }; - AbstractClass.prototype.reload = function (cb) { this.constructor.find(this.id, cb); }; diff --git a/lib/adapters/mysql.js b/lib/adapters/mysql.js index 3de4efea..a115ac35 100644 --- a/lib/adapters/mysql.js +++ b/lib/adapters/mysql.js @@ -76,6 +76,7 @@ MySQL.prototype.toDatabase = function (prop, val) { if (prop.type.name === 'Number') return val; if (val === null) return 'NULL'; if (prop.type.name === 'Date') { + if (!val) return 'NULL'; if (!val.toUTCString) { val = new Date(val); }