-
-
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/SkipsModelValidations false positive when using upsert
#1286
Labels
bug
Something isn't working
Comments
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
May 27, 2024
Fixes rubocop#1286. `Rails/SkipsModelValidations` cop is unsafe if the receiver object is not an Active Record object. So, this PR marks `SkipsModelValidations` as unsafe.
9 tasks
koic
added a commit
that referenced
this issue
May 28, 2024
…_as_unsafe [Fix #1286] Mark `Rails/SkipsModelValidations` as unsafe
I do not believe this fixes the issue. I tried gem "rubocop-rails", github: "rubocop/rubocop-rails", ref: "afcf639" but found the same error. The issue is not whether it's unsafe or safe. The issue is that the cop is applying to places where it's not relevant. Namely, any methods named |
fwolfst
pushed a commit
to fwolfst/rubocop-rails
that referenced
this issue
Jun 3, 2024
Fixes rubocop#1286. `Rails/SkipsModelValidations` cop is unsafe if the receiver object is not an Active Record object. So, this PR marks `SkipsModelValidations` as unsafe.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting a false positive for Rails/SkipsModelValidations. I have other classes that have the method
upsert
.Expected behavior
No offences detected
Actual behavior
Offenses detected
Steps to reproduce the problem
bundle exec rubocop ./example.rb
output:
RuboCop version
The text was updated successfully, but these errors were encountered: