Skip to content

Commit

Permalink
[Fix #301] Set disabled by default for Rails/PluckId
Browse files Browse the repository at this point in the history
Fixes #301.

This PR sets disabled by default for `Rails/PluckId`.
An array object does not support `ids` method, that only works for
an AR object. So, this PR defaults to prevent false alarms cause by it.
  • Loading branch information
koic committed Jul 22, 2020
1 parent fa6915f commit 9fc3f67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

* [#297](https://github.com/rubocop-hq/rubocop-rails/pull/297): Handle an upstream Ruby issue where the DidYouMean module is not available, which would break the `Rails/UnknownEnv` cop. ([@taylorthurlow][])

### Changes

* [#301](https://github.com/rubocop-hq/rubocop-rails/issues/301): Set disalbed by default for `Rails/PluckId`. ([@koic][])

## 2.7.0 (2020-07-21)

### New features
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ Rails/Pluck:
Rails/PluckId:
Description: 'Use `ids` instead of `pluck(:id)` or `pluck(primary_key)`.'
StyleGuide: 'https://rails.rubystyle.guide/#ids'
Enabled: 'pending'
Enabled: false
Safe: false
VersionAdded: '2.7'

Expand Down
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ Post.published.pluck(:title)
|===
| Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged

| Pending
| Disabled
| No
| Yes (Unsafe)
| 2.7
Expand Down

0 comments on commit 9fc3f67

Please sign in to comment.