From 286dade66ff9a22c048416aab9725f09370ffd8d Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 8 Sep 2022 16:17:44 +1000 Subject: [PATCH] Don't enforce ApplicationRecord in migrations We shouldn't use app code in migrations because app code changes while migrations should always do the same to enable old servers to upgrade. We have some existing migrations which use ApplicationRecord but I found that changing them retrospectively breaks them already. So let's leave them alone. --- .rubocop_styleguide.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.rubocop_styleguide.yml b/.rubocop_styleguide.yml index 42857db556..15f52ac883 100644 --- a/.rubocop_styleguide.yml +++ b/.rubocop_styleguide.yml @@ -44,6 +44,11 @@ Metrics/BlockLength: "xdescribe", ] +Rails/ApplicationRecord: + Exclude: + # Migrations should not contain application code: + - "db/migrate/*.rb" + Rails/SkipsModelValidations: AllowedMethods: - "touch"