-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use MiqPreloader.polymorphic_preload_for_child_classes in RelationshipMixin#fulltree_arranged #17460
Closed
NickLaMuro
wants to merge
3
commits into
ManageIQ:master
from
NickLaMuro:use_polymorphic_preloader_in_relationships
Closed
Use MiqPreloader.polymorphic_preload_for_child_classes in RelationshipMixin#fulltree_arranged #17460
NickLaMuro
wants to merge
3
commits into
ManageIQ:master
from
NickLaMuro:use_polymorphic_preloader_in_relationships
Conversation
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 is a specialized preloader for classes with polymorphic relationships that allows for targeted preloading for those specific class types on said polymorphic relationships. This allows for taking advantage of those associations by allowing scopes to be applied to the specific relationships and subsequent calls to the relationship can have those query definitions applied.
This makes a new rspec shared_context that can be used to replicate the tree building functionality in the specs that test the method `MiqPreloader.polymorphic_preload_for_child_classes`. The same data can then be used in higher level abstraction tests to confirm the functionality works as expected there as well.
NickLaMuro
force-pushed
the
use_polymorphic_preloader_in_relationships
branch
from
May 22, 2018 00:02
99725d5
to
de60597
Compare
Makes use of MiqPreloader.polymorphic_preload_for_child_classes in RelationshipMixin.fulltree_arranged to allow the caller to preload specific resource relationships and sub relationships.
NickLaMuro
force-pushed
the
use_polymorphic_preloader_in_relationships
branch
from
May 22, 2018 00:07
de60597
to
5d016ab
Compare
Checked commits NickLaMuro/manageiq@2f971d5~...5d016ab with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 lib/miq_preloader.rb
|
This was referenced May 22, 2018
Merged
This pull request has been automatically closed because it has not been updated for at least 6 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! |
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.
Second PR extracting functionality from #17354, and this is built off of #17457 which adds additional functionality to
MiqPreloader
.This change allows the
RelationshipMixin
models to use#fulltree_arranged
to apply class specific scopes and loaders to different resource types when appropriate. A follow up PR further building off this one will implement this inMiqRequestWorkflow
.Links