-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Description
Hi,
I found that the upsert method won't trigger any hook if the adapter support updateOrCreate method (mysql in my case). I debugged and found the reason in below code:
Line 336 in 04adcdb
| if (this.schema.adapter.updateOrCreate) { |
if (this.schema.adapter.updateOrCreate) {
const inst = new Model(data);
this.schema.callAdapter('updateOrCreate', Model.modelName, stripUndefined(inst.toObject(true)), (err, data) => {
if (data) {
return inst.reload(callback);
}
callback(err, null);
});
} else {
...
}I think it should trigger save/update hooks like other methods,
If you need, i can create a PR for it,
Thank you very much for a nice job!
Metadata
Metadata
Assignees
Labels
No labels