Replies: 2 comments 1 reply
-
Thank you for reporting this. I've confirmed that it is behaving as you described, which does not seem right. I've created a ticket here (https://jira.mongodb.org/browse/MONGOID-5757) to track this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
+1, but I found this while upgrading from 7.5.4 to 8.0.8 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! We've just upgraded from v8.1.4 to v8.1.5 and our tests are failing, which alerted us to the following behaviour change.
We have a parent model with embedded list of child documents like so :
Before the update, if I had a Whole with multiple failing invalid Parts, it would return all validation messages of all parts. Seems like previously .valid? was triggered on all children when .valid? was called on the parent (objects were created with nested attributes.
However AFTER the new update, we are no longer getting any validation error messages past the first one - unless the child part
.valid?
is explicitly called.Additionally after some more debugging on the new version we found that the validations for multiple embedded association was NOT triggered when parts were created these ways:
whole.parts.build(....)
Whole.new(..., parts: [{title:....}, {...}])
But however DOES get triggered if you do
whole.parts << Part.new(...)
orwhole.parts = [Part.new(...), ...]
Any light shed on this would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions