From dbdf9153346ed3aabc925eddf6280e19df519cd3 Mon Sep 17 00:00:00 2001 From: Amir Jafarian Date: Tue, 2 Feb 2016 18:27:55 -0500 Subject: [PATCH] Fix conversion for `updateAttributes` --- lib/dao.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dao.js b/lib/dao.js index 45a3562f..1c0d809e 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -58,11 +58,11 @@ function copyData(from, to) { } } -function convertDataPropertiesByType(data) { +function convertSubsetOfPropertiesByType(inst, data) { var typedData = {}; for (var key in data) { // Convert the properties by type - typedData[key] = data[key]; + typedData[key] = inst[key]; if (typeof typedData[key] === 'object' && typedData[key] !== null && typeof typedData[key].toObject === 'function') { @@ -2523,7 +2523,7 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, op inst.trigger('save', function (saveDone) { inst.trigger('update', function (done) { copyData(data, inst); - var typedData = convertDataPropertiesByType(data); + var typedData = convertSubsetOfPropertiesByType(inst, data); context.data = typedData; function updateAttributesCallback(err) {