Skip to content

Commit

Permalink
fix(model): get promise each time save() is called rather than once
Browse files Browse the repository at this point in the history
Fix #5030
  • Loading branch information
vkarpov15 committed Mar 17, 2017
1 parent 7d6c259 commit fa2caf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/services/model/applyHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ module.exports = applyHooks;
*/

function applyHooks(model, schema) {
var Promise = PromiseProvider.get();

var q = schema && schema.callQueue;
var toWrapEl;
var len;
Expand Down Expand Up @@ -102,6 +100,8 @@ function applyHooks(model, schema) {
}
model.prototype[pointCut] = (function(_newName) {
return function wrappedPointCut() {
var Promise = PromiseProvider.get();

var _this = this;
var args = [].slice.call(arguments);
var lastArg = args.pop();
Expand Down

0 comments on commit fa2caf5

Please sign in to comment.