Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/fix_prepend_migration_file_skippable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* [#1619](https://github.com/rubocop/rubocop-rails/pull/1619): Fix `MigratedSchemaVersion` setting so it works for all cops. ([@lovro-bikic][])
3 changes: 2 additions & 1 deletion lib/rubocop-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
require_relative 'rubocop/cop/rails_cops'

require_relative 'rubocop/rails/migration_file_skippable'
RuboCop::Rails::MigrationFileSkippable.apply_to_cops!

RuboCop::Cop::Base.prepend(RuboCop::Rails::MigrationFileSkippable)

RuboCop::Cop::Style::HashExcept.minimum_target_ruby_version(2.0)

Expand Down
4 changes: 0 additions & 4 deletions lib/rubocop/rails/migration_file_skippable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ def add_offense(node_or_range, message: nil, severity: nil, &block)
super if method(__method__).super_method
end

def self.apply_to_cops!
RuboCop::Cop::Registry.all.each { |cop| cop.prepend(MigrationFileSkippable) }
end

private

def already_migrated_file?
Expand Down