KEMBAR78
Rails/CreateTableWithTimestamps false positive · Issue #5503 · rubocop/rubocop · GitHub
Skip to content

Rails/CreateTableWithTimestamps false positive #5503

@mockdeep

Description

@mockdeep

When using to_proc syntax, the Rails/CreateTableWithTimestamps rule gives a false positive:

db/migrate/20130718144328_create_guest_accounts.rb:4:5: C: Rails/CreateTableWithTimestamps: Add timestamps when creating a new table.
    create_table(:guest_accounts, &:timestamps)

Expected behavior

There should be no violation reported

Actual behavior

There is a violation reported

Steps to reproduce the problem

Run against a migration that looks like:

class CreateGuestAccounts < ActiveRecord::Migration
  def change
    create_table(:guest_accounts, &:timestamps)
  end
end

RuboCop version

Include the output of rubocop -V. Here's an example:

$ rubocop -V
0.52.1 (using Parser 2.4.0.2, running on ruby 2.3.3 x86_64-linux)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions