diff --git a/lib/dao.js b/lib/dao.js index 4ed71b3e..00fbf18c 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -1175,6 +1175,10 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, cb // Convert the properties by type inst[key] = data[key]; typedData[key] = inst[key]; + if (typeof typedData[key] === 'object' + && typeof typedData[key].toObject === 'function') { + typedData[key] = typedData[key].toObject(); + } } inst._adapter().updateAttributes(model, getIdValue(inst.constructor, inst),