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

Update Boolean pretty_value to include default fallback #3379

Merged

Conversation

codealchemy
Copy link
Contributor

I wasn't able to reproduce the 🐛 seen on #1852 on recent versions of mongoid / MongoDB (issue references mongoid v4, which was released roughly 7 years ago), so this may already be resolved in more recent versions of related dependencies.

However, this change will at least prevent the interface from breaking in the event a boolean value doesn't match the explicit types checked in the case statement (closes #1852).

There's a related Rubocop cop that would flag the missing else here as well (this cop is disabled by default).

This will prevent the interface from breaking in the event a value is not correctly matched as 'true' or 'false'
@mshibuya
Copy link
Member

Could you write a spec for this?

@mshibuya mshibuya merged commit b65f150 into railsadminteam:master Sep 11, 2021
@mshibuya
Copy link
Member

Thanks!

@codealchemy codealchemy deleted the fix-boolean-pretty-value-fallback branch September 12, 2021 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

undefined method `html_safe' for nil:NilClass
2 participants