Skip to content
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

Conversation

NickLaMuro
Copy link
Member

@NickLaMuro NickLaMuro commented May 21, 2018

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 in MiqRequestWorkflow.

Links

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.
@NickLaMuro
Copy link
Member Author

@miq-bot add_label performance
@miq-bot assign @Fryguy

@Fryguy Assigning you on this one as well since you seem to have a lot of commits to RelationshipMixin. Feel free to reassign as you see fit.

cc @kbrock @syncrou

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 NickLaMuro force-pushed the use_polymorphic_preloader_in_relationships branch from 99725d5 to de60597 Compare May 22, 2018 00:02
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 NickLaMuro force-pushed the use_polymorphic_preloader_in_relationships branch from de60597 to 5d016ab Compare May 22, 2018 00:07
@miq-bot
Copy link
Member

miq-bot commented May 22, 2018

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
6 files checked, 4 offenses detected

lib/miq_preloader.rb

@miq-bot
Copy link
Member

miq-bot commented Nov 26, 2018

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants