Test cases for regression when retrieving child classes through parent#251
Open
ryanalbrecht wants to merge 5 commits intocoldbox-modules:mainfrom
Open
Test cases for regression when retrieving child classes through parent#251ryanalbrecht wants to merge 5 commits intocoldbox-modules:mainfrom
ryanalbrecht wants to merge 5 commits intocoldbox-modules:mainfrom
Conversation
-fix attribute hash test by precomputing hash -fix issue with comparison test by specifying timestamp precision on table song migration
Contributor
Author
|
I was playing around with the idea of adding another select in the What are your thoughts? |
|
This pull request has been mentioned on Ortus Solutions Community. There might be relevant details there: |
Contributor
Author
|
Another option would be to coalesce the key selections. |
Contributor
|
This is awesome @ryanalbrecht. Nicely done. I hope it gets added to the next Quick version. |
07a2f30 to
68dbfd4
Compare
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.
Its seems between v6 and v9 there was a major regression. ( edit: I think this might have always been this way)
When using multi-table inheritance and you try to load a child class through a parent entity, quick will generate a query that has a join onto each child table. As each child class will often have their foreign key to the parent named the same, this causes an issue when the child class is instantiated as it could land up with an empty value depending on the order of the joins.
This subsequently causes an exception to be thrown when updating loaded entities as the foreign key will not be present in the child class.
This is a big issue and not 100% how to fix it but I created some tests case for showing the failure and the exception