Skip to content

Commit d40c943

Browse files
committed
Fix an incorrect behavior when using AllCops: MigratedSchemaVersion
This PR fixes an incorrect behavior when using `AllCops: MigratedSchemaVersion`. This suppresses the following warning when `MigratedSchemaVersion` is defined on the user side: ```console $ bundle exec rubocop (snip) Warning: AllCops does not support MigratedSchemaVersion parameter. Supported parameters are: - RubyInterpreters - Include - Exclude - DefaultFormatter - DisplayCopNames - DisplayStyleGuide - StyleGuideBaseURL - DocumentationBaseURL - DocumentationExtension - ExtraDetails - StyleGuideCopsOnly - EnabledByDefault - DisabledByDefault - NewCops - UseCache - MaxFilesInCache - CacheRootDirectory - AllowSymlinksInCacheRootDirectory - TargetRubyVersion - ParserEngine - SuggestExtensions - ActiveSupportExtensionsEnabled - StringLiteralsFrozenByDefault ``` The default value of `AllCops: MigratedSchemaVersion` in `config/default.yml` will change from `null` to the UNIX epoch time, but typically, there should be no migration files older than the UNIX epoch time. This is a bug fix related to the plugin migration in #1434.
1 parent 405faca commit d40c943

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* [#1444](https://github.com/rubocop/rubocop-rails/pull/1444): Fix an incorrect behavior when using `AllCops: MigratedSchemaVersion`. ([@koic][])

config/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ AllCops:
2828
# By specifying `MigratedSchemaVersion` option, migration files that have been migrated can be ignored.
2929
# When `MigratedSchemaVersion: '20241231000000'` is set. Migration files lower than or equal to '20250101000000' will be ignored.
3030
# For example, this is the timestamp in db/migrate/20250101000000_create_articles.rb.
31-
MigratedSchemaVersion: ~
31+
MigratedSchemaVersion: '19700101000000' # NOTE: Used as a sentinel value for the UNIX epoch time.
3232

3333
Lint/NumberConversion:
3434
# Add Rails' duration methods to the ignore list for `Lint/NumberConversion`

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy