Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #8
As I outlined in https://discordapp.com/channels/629472241427415060/911174663076446208/940471462911950881 this is a compromise between punting to documentation or attempting to boil the ocean by reopening the Active Entity classes and trying to teach them about id and CRUD. It could be a temporary fix.
There are a number of shortcomings to this approach; several important options are not available; specifically, there is no
autosave
and nodependent
.autosave
would give some flexibility anddependent
would allow recursivedestroy
.Also, if you run
save
on an embedded child model that has versioning enabled, the recursive nature of this approach causes the child model to be saved twice, meaning that the current version will be 2.One shortcoming of this approach is that child records won't automatically pick up the parent association id:
I don't have a current fix for this beyond documentation.