[REF] Extract chunk of code relating to whether to disabled an inherited relationship #14955
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.
Overview
Fairly straight forward extraction along with a slight extension of what is enabled of the test @agilewarealok wrote for #14410
Before
Code less readable
After
Code more readable
Technical Details
#14410 stalled & is stale - I've now added the tests but the part that relates to the fix is commented out. This does not bring in any of the fix - it just extracts the code that is fixed for readability & extends the test to cover this codes original functionality. When I was looking through that PR I felt that without the code being broken out a bit I felt really uncomfortable reviewing it so cleaning up the code with an extraction seemed like a good first step towards getting it to a point where the patch could be written in a way that would not stall on getting reviewed. The next step IMHO is to add the early return / if handling into the extracted function & uncomment the next lines of code that cover it.
I did cleanup the test quite a bit in passing
Comments
will rebase once #14954 is merged