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.
This commit is contained in:
Maikel Linke
2022-09-08 16:17:44 +10:00
parent 591f901935
commit 286dade66f

View File

@@ -44,6 +44,11 @@ Metrics/BlockLength:
"xdescribe",
]
Rails/ApplicationRecord:
Exclude:
# Migrations should not contain application code:
- "db/migrate/*.rb"
Rails/SkipsModelValidations:
AllowedMethods:
- "touch"