We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The Rails/MigrationClassName cop should only trigger on the migration class that inherits from ActiveRecord::Migration.
Rails/MigrationClassName
ActiveRecord::Migration
The Rails/MigrationClassName cop will trigger on top level classes which are supporting classes that are not the migration.
Consider this example:
class NotAMigration end class ThisMigration < ActiveRecord::Migration[4.2] end
Only the second class should be affected by the cop but in fact the first one is and the second one is left alone.
1.26.0 (using Parser 3.1.1.0, rubocop-ast 1.16.0, running on ruby 3.0.2 x86_64-linux) - rubocop-minitest 0.18.0 - rubocop-performance 1.13.3 - rubocop-rails 2.14.1 - rubocop-rake 0.6.0
The text was updated successfully, but these errors were encountered:
[Fix rubocop#660] Fix a false positive for Rails/MigrationClassName
a307ec3
Fixes rubocop#660. This PR fixes a false positive for `Rails/MigrationClassName` when defining another outer class.
dae58f8
Fixes rubocop#660. This PR fixes a false positive for `Rails/MigrationClassName` when defining another class.
0bb3f22
Merge pull request #663 from koic/fix_a_false_positive_for_rails_migr…
b0f4bfd
…ation_class_name [Fix #660] Fix a false positive for `Rails/MigrationClassName`
Successfully merging a pull request may close this issue.
Expected behavior
The
Rails/MigrationClassName
cop should only trigger on the migration class that inherits fromActiveRecord::Migration
.Actual behavior
The
Rails/MigrationClassName
cop will trigger on top level classes which are supporting classes that are not the migration.Steps to reproduce the problem
Consider this example:
Only the second class should be affected by the cop but in fact the first one is and the second one is left alone.
RuboCop version
The text was updated successfully, but these errors were encountered: