You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixesrubocop#1286.
`Rails/SkipsModelValidations` cop is unsafe if the receiver object is not an Active Record object.
So, this PR marks `SkipsModelValidations` as unsafe.
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 .upsert. You could surely have an .upsert method calling an external API that has nothing to do with Rails.
fwolfst
pushed a commit
to fwolfst/rubocop-rails
that referenced
this issue
Jun 3, 2024
Fixesrubocop#1286.
`Rails/SkipsModelValidations` cop is unsafe if the receiver object is not an Active Record object.
So, this PR marks `SkipsModelValidations` as unsafe.
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: