-
-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): automatically fix wrongly assigned associations
When you use `Object.assign(entity, { ... })` instead of `entity.assign({ ... })` you could put your entity into invalid state where there will be PK instead of entity reference. With this change all managed entities will be validated before flushing and this case will be automatically handled, converting the PK to entity when persisting it. This is especially handy when you migrate existing project where you used `Object.assign(entity, { ... })` to update entities (like in TypeORM) as this kind of error could be hard to find because they were failing silently.
- Loading branch information
Martin Adamek
committed
Jun 11, 2019
1 parent
5c18fda
commit 3793c43
Showing
5 changed files
with
79 additions
and
12 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
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