diff --git a/lib/dao.js b/lib/dao.js index 2aa948a8..8fd46204 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -847,7 +847,6 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, cb var inst = this; var Model = this.constructor var model = Model.modelName; - var typedData = {}; if (typeof data === 'function') { cb = data; @@ -871,6 +870,7 @@ DataAccessObject.prototype.updateAttributes = function updateAttributes(data, cb } else { inst.trigger('save', function (saveDone) { inst.trigger('update', function (done) { + var typedData = {}; for (var key in data) { inst[key] = data[key];