Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Commit

Permalink
rename cop to be more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
6 committed Jul 8, 2017
1 parent c74646f commit a6257af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop-migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

require "rubocop/migration/version"
require "rubocop/migration/strong_migrations_checker"
require "rubocop/cop/migration/unsafe_operation"
require "rubocop/cop/migration/unsafe_migration"

module RuboCop
module Migration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module RuboCop
module Cop
module Migration
class UnsafeOperation < Cop
class UnsafeMigration < Cop
# List of all public methods that can be used within a migration method,
# like `add_index`, `rename_table`, etc.
SCHEMA_STATEMENTS = ActiveRecord::ConnectionAdapters::SchemaStatements
.public_instance_methods
.freeze
SCHEMA_STATEMENTS_PATTERN = SCHEMA_STATEMENTS.map { |s| ":#{s}" }.join(" ")

ERROR_NOTICE = "To ignore this warning, add `# rubocop:disable UnsafeOperation` above and `# rubocop:enable UnsafeOperation` below your code."
ERROR_NOTICE = "To ignore this warning, add `# rubocop:disable UnsafeMigration` above and `# rubocop:enable UnsafeMigration` below your code."

# Handle `ActiveRecord::Migration` and `ActiveRecord::Migration[5.0]`
def_node_matcher :migration_class?, <<-PATTERN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe RuboCop::Cop::Migration::UnsafeOperation do
describe RuboCop::Cop::Migration::UnsafeMigration do
subject(:cop) { described_class.new }

before do
Expand Down

0 comments on commit a6257af

Please sign in to comment.