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
The `Rails/SkipsModelValidations` cop currently incorrectly registers an
offense for the `touch` method from Shoulda Matchers' associations DSL:
it { is_expected.to belong_to(:user).touch(true) }
Active Record's `touch` method accepts attribute names, so we can treat
`touch` calls that pass boolean literal arguments as false positives.
Rails/SkipsModelValidations cop doesn't complain about the following relation:
belongs_to :user, touch: true
but it does complain in its test (Avoid using touch because it skips validations.):
it { should belong_to(:user).touch(true) }
Expected behavior
Complain in both cases or in any of them. I would say that it should also complain in the relation.
RuboCop version
Originally opened at rubocop/rubocop#4098
The text was updated successfully, but these errors were encountered: