-
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
Remove empty array associations created via UI from association list #16919
Conversation
@miq-bot add_label cleanup |
3863a0a
to
636173f
Compare
Checked commit d-m-u@636173f with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -57,7 +57,7 @@ def check_dialog_fields_for_validity(dialog_fields) | |||
|
|||
def check_dialog_associations_for_validity(dialog_fields) | |||
associations = {} | |||
dialog_fields.each { |df| associations.merge!(df["name"] => df["dialog_field_responders"]) unless df["dialog_field_responders"].nil? } | |||
dialog_fields.each { |df| associations.merge!(df["name"] => df["dialog_field_responders"]) if df["dialog_field_responders"].present? } | |||
unless associations.blank? |
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.
Rubocop is not complaining about the line you changed, but does about line 61 that you reverted back. 😕
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.
Okay, but I still think this needs to be a stricter check, that of presence, rather than the one that's existing, because the UI associations have blank arrays that need to be dealt with here.
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.
What confused me is the PR is labeled as cleanup
but I think you are really addressing a bug
. I initially thought this was just a refactoring based on rubocop warnings. Re-reading the description it sounds like it is a bug.
@d-m-u Please add BZ link. |
Remove empty array associations created via UI from association list (cherry picked from commit bcc70a2) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1559475
Gaprindashvili backport details:
|
This check needs to be a present because it needs to remove associations whose values are merely an empty array, which present does but the existing code won't.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1559377