Skip to content

Commit 8434627

Browse files
committed
Unmark AutoCorrect: false from Rails/UniqBeforePluck
This `AutoCorrect: false` looks like it was set when there was no way to safe autocorrect by `SafeAutocorrect: false`. Test code for the autocorrection exists. So it can be enabled by default. However, it is still unsafe because `SafeAutocorrect: false`.
1 parent 3d5e697 commit 8434627

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#580](https://github.com/rubocop/rubocop-rails/pull/580): Unmark `AutoCorrect: false` from `Rails/UniqBeforePluck`. ([@koic][])

config/default.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,12 @@ Rails/UniqBeforePluck:
820820
Description: 'Prefer the use of uniq or distinct before pluck.'
821821
Enabled: true
822822
VersionAdded: '0.40'
823-
VersionChanged: '2.8'
823+
VersionChanged: '2.13'
824824
EnforcedStyle: conservative
825825
SupportedStyles:
826826
- conservative
827827
- aggressive
828828
SafeAutoCorrect: false
829-
AutoCorrect: false
830829

831830
Rails/UniqueValidationWithoutIndex:
832831
Description: 'Uniqueness validation should have a unique index on the database column.'

docs/modules/ROOT/pages/cops_rails.adoc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4875,7 +4875,7 @@ end
48754875
| Yes
48764876
| Yes (Unsafe)
48774877
| 0.40
4878-
| 2.8
4878+
| 2.13
48794879
|===
48804880

48814881
Prefer the use of distinct, before pluck instead of after.
@@ -4940,10 +4940,6 @@ Model.distinct.pluck(:id)
49404940
| EnforcedStyle
49414941
| `conservative`
49424942
| `conservative`, `aggressive`
4943-
4944-
| AutoCorrect
4945-
| `false`
4946-
| Boolean
49474943
|===
49484944

49494945
== Rails/UniqueValidationWithoutIndex

0 commit comments

Comments
 (0)