You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# db/migrate/some_migration.rb:1:1: C: Rails/ReversibleMigrationMethodDefinition: Migrations must contain either a change method, or both an up and a down method.# class SomeMigration < ActiveRecord::Migration[7.1] ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Steps to reproduce the problem
Create file db/migrate/some_migration.rb
Copy the file content from above
Run RuboCop with rubocop-rails required and the Rails/ReversibleMigrationMethodDefinition cop enabled
The text was updated successfully, but these errors were encountered:
marcoroth
changed the title
Rails/ReversibleMigrationMethodDefinition false positive for up and down when defined as class methodsRails/ReversibleMigrationMethodDefinition false positive when up and down defined as class methods
Jan 24, 2024
Expected behavior
A migration like this shouldn't add a
Rails/ReversibleMigrationMethodDefinition
offense:Actual behavior
It's adding the following offense:
Steps to reproduce the problem
db/migrate/some_migration.rb
rubocop-rails
required and theRails/ReversibleMigrationMethodDefinition
cop enabledRuboCop version
The text was updated successfully, but these errors were encountered: