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 #1130] Fix crash for Rails/UniqueValidationWithoutIndex with bare validate #1131

Merged
merged 1 commit into from
Sep 25, 2023
Merged

[Fix #1130] Fix crash for Rails/UniqueValidationWithoutIndex with bare validate #1131

merged 1 commit into from
Sep 25, 2023

Conversation

jamiemccarthy
Copy link
Contributor

This PR fixes #1130 , a bug in Rails/UniqueValidationWithoutIndex that raises an exception if some (admittedly invalid) code is encountered.

It's just a method call on an object that might be nil. Since &. was added in ruby 2.3 and the gemspec requires ruby 2.7, I used that to fix it.

Tests that trigger the exception are added.

I'm happy to make any changes requested.

@koic koic merged commit 7a0208b into rubocop:master Sep 25, 2023
4 checks passed
@koic
Copy link
Member

koic commented Sep 25, 2023

Great! Thanks!

@jamiemccarthy jamiemccarthy deleted the jm-unique-validation-fix branch September 25, 2023 14:18
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.

UniqueValidationWithoutIndex raises NoMethodError on empty validates
2 participants