Remove undefined for the data to be saved

This commit is contained in:
Raymond Feng 2014-05-09 09:59:34 -07:00
parent 4a907b0a18
commit 0bcbe6ceae
1 changed files with 1 additions and 0 deletions

View File

@ -771,6 +771,7 @@ DataAccessObject.prototype.save = function (options, callback) {
function save() { function save() {
inst.trigger('save', function (saveDone) { inst.trigger('save', function (saveDone) {
inst.trigger('update', function (updateDone) { inst.trigger('update', function (updateDone) {
data = removeUndefined(data);
inst._adapter().save(modelName, inst.constructor._forDB(data), function (err) { inst._adapter().save(modelName, inst.constructor._forDB(data), function (err) {
if (err) { if (err) {
return callback(err, inst); return callback(err, inst);