Class: RuboCop::Cop::Migration::CreateTableForce
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Migration::CreateTableForce
- Extended by:
- AutoCorrector
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/migration/create_table_force.rb
Overview
Create tables without ‘force: true` option.
The ‘force: true` option can drop an existing table. If you indend to drop an existing table, explicitly call `drop_table` first.
Constant Summary collapse
- MSG =
'Create tables without `force: true` option.'- RESTRICT_ON_SEND =
i[ create_table ].freeze
Instance Method Summary collapse
- #on_send(node) ⇒ void (also: #on_csend)
Instance Method Details
#on_send(node) ⇒ void Also known as: on_csend
This method returns an undefined value.
38 39 40 41 42 43 44 45 |
# File 'lib/rubocop/cop/migration/create_table_force.rb', line 38 def on_send(node) option_node = option_force_true_from_create_table(node) return unless option_node add_offense(option_node) do |corrector| autocorrect(corrector, option_node) end end |