Class: RuboCop::Cop::Migration::AddForeignKey
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Migration::AddForeignKey
- Extended by:
- AutoCorrector
- Includes:
- RangeHelp
- Defined in:
- lib/rubocop/cop/migration/add_foreign_key.rb
Overview
Activate foreign key validation in a separate migration in PostgreSQL.
To avoid blocking writes on both tables.
Constant Summary collapse
- MSG =
'Activate foreign key validation in a separate migration in PostgreSQL.'- RESTRICT_ON_SEND =
%i[ add_foreign_key add_reference ].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.
47 48 49 50 51 52 53 |
# File 'lib/rubocop/cop/migration/add_foreign_key.rb', line 47 def on_send(node) return unless bad?(node) add_offense(node) do |corrector| autocorrect(corrector, node) end end |