Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Table::save() not pre-validating all entities.
This change fixes #3600, and dramatically changes how save() works. Instead of validating and saving entities in sequence, all entities are pre-validated. If all validation succeeds then entities will be saved. This makes the 'validate' option act like validate=first in 2.x. The 'atomic' is almost entirely orthogonal controlling whether or not the save is run in a transaction or not. The associated parents do not need to be revalidated so we can disable validation for them. However, child association do need further validation as the save process for belongsToMany materializes new objects that need validation applied.
- Loading branch information
Showing
3 changed files
with
36 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters