From 04e800089ef8d1b719187d4eab472404568de484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=AA=E0=A5=8D=E0=A4=B0=E0=A4=A5=E0=A4=AE=E0=A5=87?= =?UTF-8?q?=E0=A4=B6=20Sonpatki?= Date: Tue, 30 Jul 2019 13:49:19 +0530 Subject: [PATCH] Make ActiveRecordAliases scope false We faced an issue where our custom `update_attributes` method call was changed to `update` but the method name remained same in the method definition. ```ruby def update_attributes end update_attributes ``` ```ruby def update_attributes end update ``` So the cop is not safe for auto correct. --- config/default.yml | 1 + manual/cops_rails.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/default.yml b/config/default.yml index e8ea60d302..f733153b13 100644 --- a/config/default.yml +++ b/config/default.yml @@ -31,6 +31,7 @@ Rails/ActiveRecordAliases: Use `update!` instead of `update_attributes!`. Enabled: true VersionAdded: '0.53' + Safe: false Rails/ActiveRecordOverride: Description: >- diff --git a/manual/cops_rails.md b/manual/cops_rails.md index 017184d3c2..b55c1684e7 100644 --- a/manual/cops_rails.md +++ b/manual/cops_rails.md @@ -51,7 +51,7 @@ Include | `app/controllers/**/*.rb` | Array Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.53 | - +Enabled | No | Yes | 0.53 | - Checks that ActiveRecord aliases are not used. The direct method names are more clear and easier to read.