Skip to content

Commit

Permalink
Merge pull request #4 from zlotnika/this
Browse files Browse the repository at this point in the history
use correct this when chaining callbacks
  • Loading branch information
notheotherben committed Oct 23, 2013
2 parents 35e54c6 + 0e9fb3d commit 3b8c156
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/orm-timestamps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -68,4 +69,4 @@ function Plugin(db, opts) {
}
};

module.exports = Plugin;
module.exports = Plugin;

0 comments on commit 3b8c156

Please sign in to comment.