Fix updateOrCreate transaction propagation

This commit is contained in:
Rus1 2015-06-23 19:14:36 +03:00
parent d495a26a76
commit 17cac79b09
1 changed files with 5 additions and 1 deletions

View File

@ -505,7 +505,11 @@ DataAccessObject.updateOrCreate = DataAccessObject.upsert = function upsert(data
}
});
} else {
Model.findOne({ where: ctx.query.where }, { notify: false }, function (err, inst) {
var opts = {notify: false};
if (ctx.options && ctx.options.transaction) {
opts.transaction = ctx.options.transaction;
}
Model.findOne({where: ctx.query.where}, opts, function (err, inst){
if (err) {
return cb(err);
}