Remove undefined for the data to be saved
This commit is contained in:
parent
4a907b0a18
commit
0bcbe6ceae
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue