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

Fixes #18446 - Hide label fields when the value is empty or nil #232

Merged
merged 1 commit into from
Feb 14, 2017

Conversation

tstrachota
Copy link
Member

No description provided.

Copy link
Member

@ares ares left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion

@@ -85,7 +85,7 @@ class Label < ContainerField
def display?(value)
return true if not hide_blank?

fields.any? do |f|
!(value.nil? || value.empty?) && fields.any? do |f|
Copy link
Member

@ares ares Feb 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this equivalent to value.present? && fields.any? do |f|

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, hammer probably does not depend on active support gem, sorry, dismiss :-)

@shlomizadok
Copy link
Member

LGTM 👍

@tstrachota
Copy link
Member Author

Thanks guys, merging

@tstrachota tstrachota merged commit 04f4d5d into theforeman:master Feb 14, 2017
@tstrachota tstrachota deleted the label_fix branch May 17, 2017 07:54
This pull request was closed.
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.

4 participants