From 0e9fb3d37d4722bc3d6ff81b15a6f30855762f84 Mon Sep 17 00:00:00 2001 From: Alex Zlotnik Date: Tue, 22 Oct 2013 15:19:12 -0700 Subject: [PATCH] use correct this when chaining callbacks --- lib/orm-timestamps.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/orm-timestamps.js b/lib/orm-timestamps.js index 9ae499d..6769021 100644 --- a/lib/orm-timestamps.js +++ b/lib/orm-timestamps.js @@ -27,8 +27,9 @@ function Plugin(db, opts) { next(); } + var that = this; oldHook.call(this, function() { - cont.call(this); + cont.call(that); }); if(oldHook.length == 0) cont.call(this); @@ -68,4 +69,4 @@ function Plugin(db, opts) { } }; -module.exports = Plugin; \ No newline at end of file +module.exports = Plugin;