Closed
Description
Rails/ReversibleMigration
cop throw an offense even when the method change_table_comment
pass a hash with :from
and :to
Expected behavior
Only throw an offense if it's not a hash with :from
and :to
Actual behavior
db/migrate/20191031164441_add_comments_to_table.rb:5:5: C: Rails/ReversibleMigration: change_table_comment is not reversible.
change_table_comment :foo, from: 'old_comment', to: 'new_comment'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Steps to reproduce the problem
Just create a migration with change_table_comment
class AddComentsToPosts < ActiveRecord::Migration[6.0]
def change
change_table_comment :foo, from: 'old comment', to: 'new_comment'
end
end
RuboCop version
$ [bundle exec] rubocop -V
0.76.0 (using Parser 2.6.5.0, running on ruby 2.5.7 x86_64-linux)
Activity