Class: RuboCop::Cop::Doctolib::NoUnsafeBackgroundMigration

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/doctolib/no_unsafe_background_migration.rb

Overview

Flag migrations which alter the “shape” of the schema.

Examples:


# bad
add_column :foos, :bar, :text

# good
add_index :foos, :bar

Constant Summary collapse

MSG =
'Only use background migrations for index creation, column deletion or table deletion.'

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



39
40
41
# File 'lib/rubocop/cop/doctolib/no_unsafe_background_migration.rb', line 39

def on_send(node)
  add_offense(node) if unsafe_operation?(node)
end