Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Rails/CreateTableWithTimestamps respect active_storage_variant_records table #570

Commits on Oct 2, 2021

  1. Make Rails/CreateTableWithTimestamps respect `active_storage_varian…

    …t_records` table
    
    This PR makes `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.
    
    It suppresses the following offense.
    
    ```console
    % bin/rails -v
    Rails 6.1.4.1
    
    % bin/rails active_storage:install
    Copied migration
    20210929095151_create_active_storage_tables.active_storage.rb from active_storage
    
    % bundle exec rubocop --only Rails/CreateTableWithTimestamps
    Inspecting 1 file
    C
    
    Offenses:
    
    db/migrate/20210929095151_create_active_storage_tables.active_storage.rb:28:5:
    C: Rails/CreateTableWithTimestamps: Add timestamps when creating a new table.
    create_table :active_storage_variant_records do |t| ...
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    1 file inspected, 1 offense detected
    ```
    
    As far as I've heard from Rails committers, `active_storage_variant_records` table hasn't timestamp columns,
    probably as a result of discussions in the Rails community. If you want to consider the need,
    please discuss it with https://discuss.rubyonrails.org and give us feedback.
    koic committed Oct 2, 2021
    Configuration menu
    Copy the full SHA
    b861061 View commit details
    Browse the repository at this point in the history