Merge pull request #642 from rus0000/rus0000-patch-1-fix-updateOrCreate-transaction
Fix updateOrCreate transaction propagation
This commit is contained in:
commit
506abf134e
|
@ -532,7 +532,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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue