Closed
Description
Currently, Rails/ThreeStateBooleanColumn
assumes that the table name and the column name are literals. Passing in a variable or a constant raises a parse exception:
An error occurred while Rails/ThreeStateBooleanColumn cop was inspecting
db/migrate/test.rb:42:6.
undefined method `value' for s(:const, nil, :column):RuboCop::AST::ConstNode
Sample migration:
def up
table = :users
column = :is_admin
add_column :users, :is_admin, :boolean # ✔️
add_column table, :is_admin, :boolean # 💥parse exception
add_column :users, column, :boolean # 💥parse exception
end
(version rubocop-rails-2.19.1)
Activity