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

Fix ActiveSupport::Inflector.humanize(nil) #48800

Merged
merged 1 commit into from Jul 25, 2023

Conversation

robinjam
Copy link
Contributor

Motivation / Background

Fixes a regression introduced in #48348.

In activesupport v7.0.5.1, ActiveSupport::Inflector.humanize(nil) returned "".
In activesupport v7.0.6, it raises NoMethodError: undefined method `end_with?' for nil:NilClass.

Detail

This PR adds a regression test to surface the issue, and restores the original behaviour.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

robinjam added a commit to alphagov/content-data-admin that referenced this pull request Jul 25, 2023
`humanize(nil)` currently raises ``NoMethodError: undefined method `end_with?' for nil:NilClass`` due to a regression in Rails 7.0.6 (see rails/rails#48800)
@byroot byroot merged commit d580a77 into rails:main Jul 25, 2023
9 checks passed
byroot added a commit that referenced this pull request Jul 25, 2023
Fix `ActiveSupport::Inflector.humanize(nil)`
@byroot
Copy link
Member

byroot commented Jul 25, 2023

Thanks. Backported to 7-0-stable.

@robinjam robinjam deleted the fix-humanize-nil branch July 25, 2023 19:39
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.

None yet

2 participants