diff --git a/changelog/change_make_create_table_with_timestamps_aware_of_ast_variant_records.md b/changelog/change_make_create_table_with_timestamps_aware_of_ast_variant_records.md new file mode 100644 index 0000000000..5f7ce322d8 --- /dev/null +++ b/changelog/change_make_create_table_with_timestamps_aware_of_ast_variant_records.md @@ -0,0 +1 @@ +* [#570](https://github.com/rubocop/rubocop-rails/pull/570): Make `Rails/CreateTableWithTimestamps` respect `active_storage_variant_records` table of `db/migrate/*_create_active_storage_tables.active_storage.rb` auto-generated by `bin/rails active_storage:install` even if `created_at` is not specified. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index 13f3454afb..b20840459e 100644 --- a/config/default.yml +++ b/config/default.yml @@ -201,6 +201,10 @@ Rails/CreateTableWithTimestamps: VersionAdded: '0.52' Include: - db/migrate/*.rb + Exclude: + # Respect the `active_storage_variant_records` table of `*_create_active_storage_tables.active_storage.rb` + # auto-generated by `bin/rails active_storage:install` even if `created_at` is not specified. + - db/migrate/*_create_active_storage_tables.active_storage.rb Rails/Date: Description: >- diff --git a/docs/modules/ROOT/pages/cops_rails.adoc b/docs/modules/ROOT/pages/cops_rails.adoc index dd0765a1da..26b0448e0a 100644 --- a/docs/modules/ROOT/pages/cops_rails.adoc +++ b/docs/modules/ROOT/pages/cops_rails.adoc @@ -923,6 +923,10 @@ end | Include | `db/migrate/*.rb` | Array + +| Exclude +| `db/migrate/*_create_active_storage_tables.active_storage.rb` +| Array |=== == Rails/Date