-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save() callback does not work if autoFetch enabled #256
Comments
Can you please test the latest git version? # this gets package from git
npm install dresende/node-orm2 Also, if the version doesn't work, can you give some more information about |
I've tested on the latest git version and it's still does not work. There is request data (all foreign keys are valid):
|
I'm not having this problem, with or without the validations. Thinking about it, it does not make sense that the validations in another model will interfere with this model. Are you sure it's that controller code? Isn't other that gets a user or something? |
Hi, I think it's the same issue. I write this test:
When I show It's funny because if I add the line |
If you try using It does introduce the question of how to handle such things however, take this situation for example:
Do we remove @dresende Sounds to me like it isn't incrementing the changes counter for some reason, and assuming (incorrectly) that the changes have already been saved to the DB. Hence the setting of the name property (which would obviously increment the changes counter) fixing it. |
Yes, this can probably be fixed by monitoring association keys like we monitor model properties. I'll see if I can make a simple fix. |
Baah.. took me 1h to figure the right line to change :) It feels really good when you make a small change and it just works. |
This has regressed but should now be fixed in master. |
In the code below save() method (in announcement_controller.js) does not saving changes in user_id field. If i uncomment a validation rules in the announcement model definition then it's saving successfully, but save() method`s callback does not work. It saves successfully if i remove "autoFetch: true" (v2.0.15).
models.js:
announcement_controller.js:
The text was updated successfully, but these errors were encountered: