Skip to content

Commit

Permalink
Only use currentInstance for updateAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien committed Mar 6, 2015
1 parent 2c985e5 commit a08047b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/dao.js
Original file line number Diff line number Diff line change
Expand Up @@ -1746,7 +1746,7 @@ DataAccessObject.prototype.remove =
var context = {
Model: Model,
where: ctx.query.where,
currentInstance: inst,
instance: inst,
hookState: hookState
};
Model.notifyObserversOf('before delete', context, function(err, ctx) {
Expand All @@ -1765,7 +1765,7 @@ DataAccessObject.prototype.remove =
var context = {
Model: Model,
where: where,
currentInstance: inst,
instance: inst,
hookState: hookState
};
Model.notifyObserversOf('after delete', context, function(err) {
Expand All @@ -1786,7 +1786,7 @@ DataAccessObject.prototype.remove =
var context = {
Model: Model,
where: where,
currentInstance: inst,
instance: inst,
hookState: hookState
};
Model.notifyObserversOf('after delete', context, function(err) {
Expand Down
8 changes: 4 additions & 4 deletions test/persistence-hooks.suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ module.exports = function(dataSource, should) {
if (err) return done(err);
observedContexts.should.eql(aTestModelCtx({
where: { id: existingInstance.id },
currentInstance: existingInstance
instance: existingInstance
}));
done();
});
Expand Down Expand Up @@ -1087,7 +1087,7 @@ module.exports = function(dataSource, should) {
if (err) return done(err);
observedContexts.should.eql(aTestModelCtx({
where: { id: existingInstance.id },
currentInstance: existingInstance
instance: existingInstance
}));
done();
});
Expand Down Expand Up @@ -1129,12 +1129,12 @@ module.exports = function(dataSource, should) {
aTestModelCtx({
hookState: { foo: 'bar', test: true },
where: { id: '1' },
currentInstance: existingInstance
instance: existingInstance
}),
aTestModelCtx({
hookState: { foo: 'BAR', test: true },
where: { id: '1' },
currentInstance: existingInstance
instance: existingInstance
})
]);
done();
Expand Down

0 comments on commit a08047b

Please sign in to comment.