Skip to content

Commit

Permalink
[Fix rubocop#403] Mark Rails/WhereEquals as unsafe auto-correction
Browse files Browse the repository at this point in the history
Fixes rubocop#403 and rubocop#418.

This PR marks `Rails/WhereEquals` as unsafe auto-correction.
  • Loading branch information
koic committed Apr 27, 2021
1 parent c63330e commit 995f934
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
* [#444](https://github.com/rubocop/rubocop-rails/issues/444): Mark `Rails/Blank` as unsafe auto-correction. ([@koic][])
* [#451](https://github.com/rubocop/rubocop-rails/issues/451): Make `Rails/RelativeDateConstant` aware of `yesterday` and `tomorrow` methods. ([@koic][])
* [#454](https://github.com/rubocop/rubocop-rails/pull/454): Mark `Rails/WhereExists` as unsafe auto-correction. ([@koic][])
* [#403](https://github.com/rubocop/rubocop-rails/pull/403): Mark `Rails/WhereEquals` as unsafe auto-correction. ([@koic][])
* [#379](https://github.com/rubocop/rubocop-rails/issues/379): Mark `Rails/DynamicFindBy` as unsafe. ([@koic][])
* [#456](https://github.com/rubocop/rubocop-rails/pull/456): Drop Ruby 2.4 support. ([@koic][])
* [#462](https://github.com/rubocop/rubocop-rails/pull/462): Require RuboCop 1.7 or higher. ([@koic][])


## 2.9.1 (2020-12-16)

### Bug fixes
Expand Down
2 changes: 2 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,9 @@ Rails/WhereEquals:
Description: 'Pass conditions to `where` as a hash instead of manually constructing SQL.'
StyleGuide: 'https://rails.rubystyle.guide/#hash-conditions'
Enabled: 'pending'
SafeAutoCorrect: false
VersionAdded: '2.9'
VersionChanged: '2.10'

Rails/WhereExists:
Description: 'Prefer `exists?(...)` over `where(...).exists?`.'
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4585,9 +4585,9 @@ validates :foo, uniqueness: true

| Pending
| Yes
| Yes
| Yes (Unsafe)
| 2.9
| -
| 2.10
|===

This cop identifies places where manually constructed SQL
Expand Down

0 comments on commit 995f934

Please sign in to comment.