Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Rails/SaveBang as unsafe autocorrect #101

Merged
merged 1 commit into from Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@
### Changes

* [#98](https://github.com/rubocop-hq/rubocop-rails/pull/98): Mark `Rails/ActiveRecordAliases` as `SafeAutoCorrect` false and disable autocorrect by default. ([@prathamesh-sonpatki][])
* [#101](https://github.com/rubocop-hq/rubocop-rails/pull/101): Mark `Rails/SaveBang` as `SafeAutoCorrect` false and disable autocorrect by default. ([@prathamesh-sonpatki][])

## 2.2.1 (2019-07-13)

Expand Down
1 change: 1 addition & 0 deletions config/default.yml
Expand Up @@ -404,6 +404,7 @@ Rails/SaveBang:
VersionChanged: '0.59'
AllowImplicitReturn: true
AllowedReceivers: []
SafeAutoCorrect: false

Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.'
Expand Down
2 changes: 1 addition & 1 deletion manual/cops_rails.md
Expand Up @@ -2064,7 +2064,7 @@ ConvertTry | `false` | Boolean

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
Disabled | Yes | Yes | 0.42 | 0.59
Disabled | Yes | Yes (Unsafe) | 0.42 | 0.59

This cop identifies possible cases where Active Record save! or related
should be used instead of save because the model might have failed to
Expand Down