From 5252d0e8058f8654efa163ff4734f6a6f80c8445 Mon Sep 17 00:00:00 2001 From: arlaneenalra Date: Wed, 5 Feb 2014 22:21:27 -0600 Subject: [PATCH] Move new var into thunk. There really was no reason for it to be in the outer context. --- lib/dao.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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];