mongoose-sequence
mongoose-sequence copied to clipboard
issue #45 - implement setNext changes to allow its usage within pre-s…
Allow use a setNext within the pre-save hook in making save optional through new args.
Preserve current behaviour in making save the default behaviour if no arg set
Coverage decreased (-1.6%) to 98.425% when pulling c8474d5f1600093d4729cd8ce0cb1d8055d4701c on rernens:setNext-within-pre-save-hook into 94b4daf224ca175954df96ea1f4c6c796dcb4e95 on ramiel:develop.
Coverage decreased (-1.6%) to 98.425% when pulling c8474d5f1600093d4729cd8ce0cb1d8055d4701c on rernens:setNext-within-pre-save-hook into 94b4daf224ca175954df96ea1f4c6c796dcb4e95 on ramiel:develop.
Hello @rernens , sorry for coming back so late to you but I had no time at all to look at this. I ned to fin the time to look at it carefully. Maybe you could add some test case? Also, if you need it in your projects you can include it in your dependencies like this in your package.json
"mongoose-sequence": "rernens/mongoose-sequence#setNext-within-pre-save-hook"
I'm sure you already know. Sorry, this will take some other time for me. Busy days! Thank you for it in any case!!
So, your intent is to make this kind of calls?
this.setNext('employees_counter', false, (err) => {
...
});
and so the save won't be called? I understand. I also remember that a previous version of this plugin did not save and you had to call save explicitely. I think this PR is a good idea. It needs some test and an update to the documentation. I hope you can do it or I must take over whenever I'll have time.
@ramiel
Hi Fabrizio
You are right, this PR allows to keep the current behavior as well as integrating the required behavior to use setNext within a pre-save hook.
I am using it in a web app that went live yesterday.
While as busy as you are, I will try to find some time over the next 72 hours, to change the doc and write some test.
Hi guys, any update on this PR? We need this please...