-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Rails/RedundantPresenceValidationOnBelongsTo breaks code validation #1319
Comments
Can you show the error and which version of rails you are using? Your RuboCop version is also somewhat old, please upgrade and do the same for |
rails: 5.2.3 The error message is:
Stack trace:
|
Earlopain
added a commit
to Earlopain/rubocop-rails
that referenced
this issue
Aug 2, 2024
…nOnBelongsTo` If presence is the only validation option and other non-validation options are present, removing it will cause rails to error.
Thanks, I thought it had something to do with old rails but it seems that this autocorrect is just invalid code in all versions of it. Fix at #1320 |
Thanks.
W dniu pt., 2.08.2024 o 16:02 Earlopain ***@***.***>
napisał(a):
… Thanks, I thought it had something to do with old rails but it seems that
this autocorrect is just invalid code in all versions of it. Fix at #1320
<#1320>
—
Reply to this email directly, view it on GitHub
<#1319 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMRLKZDGWMUCDARPLIWXI3ZPOGN7AVCNFSM6AAAAABL4DUHSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRVGQ3DQMZYHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
koic
added a commit
that referenced
this issue
Aug 2, 2024
…nce-validation [Fix #1319] Fix false positive for `RedundantPresenceValidationOnBelongsTo`
koic
pushed a commit
to koic/rubocop-rails
that referenced
this issue
Aug 23, 2024
…nOnBelongsTo` If presence is the only validation option and other non-validation options are present, removing it will cause rails to error.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I applied corrections and it broke my code.
Before:
After:
Fixed:
The code autocorrector does take off the presence validator, and then rails complains about not having a single validator on the line where it
validates
.Expected behavior
Does not break existing validate rules.
Actual behavior
Server does not stand up due to error.
Steps to reproduce the problem
bundle exec rubocop -A
RuboCop version
The text was updated successfully, but these errors were encountered: