Skip to content

Conversation

jamis
Copy link
Contributor

@jamis jamis commented Jul 31, 2025

With #6012 (MONGOID-5848, reverting a change that caused a performance regression), validation failures of deeply nested children (i.e. grandchildren and deeper) no longer interrupt the transaction for saving a parent. This PR addresses that by adding a new internal flag (children_may_have_changed) that the changed API now uses to indicate whether a document should validate it's children or not.

The value of that flag is set to true when a child document is processed via nested attributes.

@jamis jamis requested a review from a team as a code owner July 31, 2025 16:08
@jamis jamis requested a review from comandeo-mongo July 31, 2025 16:08
@jamis jamis added the bug Fixes a bug, with no new features or broken compatibility label Aug 20, 2025
@jamis jamis merged commit 5376919 into mongodb:master Aug 20, 2025
62 checks passed
@jamis jamis deleted the 5888-grandchild-validations branch August 20, 2025 21:00
jamis added a commit to jamis/mongoid that referenced this pull request Aug 20, 2025
…ongodb#6028)

* MONGOID-5888 make sure nested attributes trigger validations on deeply nested children

* code review feedback
jamis added a commit that referenced this pull request Aug 21, 2025
…6028) (#6029)

* MONGOID-5888 make sure nested attributes trigger validations on deeply nested children

* code review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes a bug, with no new features or broken compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants