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
set @root_class
only if it is not already set by subclass
#5658
Conversation
setting `@root_class` here was causing incorrect filters to load for Instances/Images Accordions in Cloud/Instances explorer. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1715462
Checked commit h-kataria@89fc580 with ruby 2.3.3, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 app/presenters/tree_builder_vms_filter.rb
|
@@ -1,6 +1,6 @@ | |||
class TreeBuilderVmsFilter < TreeBuilder | |||
def initialize(*args) | |||
@root_class = 'ManageIQ::Providers::InfraManager::Vm' | |||
@root_class ||= 'ManageIQ::Providers::InfraManager::Vm' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this can be previously set 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreeBuilderImagesFilter, TreeBuilderVmsInstancesFilter, TreeBuilderInstancesFilter, TreeBuilderTemplatesImagesFilter and TreeBuilderTemplateFilter all set @root_class
before calling super
in the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skateman do you want this changed, or are you ok with this as is?
(We could probably just move the assignment after super
in all the classes, solving the problem too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, yes constructor redefinition call order, sure I'm fine
LGTM, without this PR I see the same list of filters everywhere (instances, images, vms, templates), |
setting
@root_class
here was causing incorrect filters to load for Instances/Images Accordions in Cloud/Instances explorer.Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1715462
before
after