Repository navigation
[WIP] Allow cast_assoc to work inside embeds - #1833
Closed
michalmuskala wants to merge 1 commit into
Closed
michalmuskala wants to merge 1 commit into
michalmuskala wants to merge 1 commit into
Conversation
The issue is that embeds don't have the __meta__ field, so we want to raise only for regular schemas. This, unfortunately, creates another problem. We don't know if the embed was just created or loaded from database and needs preloading the association data. This is very risky to use as it may cause data loss if used improperly.
michalmuskala
force-pushed
the
mm/embed-assoc
branch
from
December 5, 2016 23:14
0fa4c97 to
bc78dd5
Compare
Member
|
Sounds good to me. |
Member
Author
|
Closing in favour of the more comprehensible #1837 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The issue is that embeds don't have the
__meta__field, so we want toraise only for regular schemas.
This, unfortunately, creates another problem. We don't know if the embed
was just created or loaded from database and needs preloading the
association data. This is very risky to use as it may cause data loss
if used improperly.
The use case for associations inside embeds is NoSQL databases, where this seems like a reasonable thing to do.
If we're going to merge this, we need more tests around this functionality.