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 (Inflector::Methods#underscore): small regression #43552

Merged

Conversation

Thornolf
Copy link
Contributor

Summary

After this pull request was merged : dd5b00c, a tiny regression appeared on ActiveSupport::Inflector.underscore for some cases

Before when we were using the method underscore on Accountsv2N2Test it was returning this : accountsv2_n2_test but after the modifications, it was only returning this : accountsv2n2_test

To fix this we modified the regex from /([A-Z\d]+)(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/ to /([A-Z]+)(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/ and we added a little test case to it.

Please feel free to ask me any question about it.

Best regards,

Thornolf

@kamipo kamipo merged commit 96df650 into rails:main Oct 29, 2021
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