Closed ersims closed 8 years ago
Just realized that this is intentional (#139 and #34), and I totally agree with a patchAndFetch
method to solve this usecase.
The documentation should probably be changed to not indicate that the patch method returns the updated model.
I'll update the documentation. Also the original person should be updated so we may have a bug there. I'll look into that one.
Hi,
I have encountered an issue with patching model instances. Documentation indicates that patching a model instance should return the updated model. In my case it returns a number (number of affected rows?). Complete code to reproduce below.
I am using the latest release of Objection.js (0.5.2) and Knex.js (0.11.7) and the issue exists for postgres as well.
Code to reproduce
Expected result
Actual result
Workaround A simple workaround is to re-query the model instance after patching it