Class: RuboCop::Cop::Dutchie::MigrationSafetyAssured
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Dutchie::MigrationSafetyAssured
- Defined in:
- lib/rubocop/cop/dutchie/migration_safety_assured.rb
Overview
Flags usage of safety_assured in migrations
The safety_assured block bypasses strong_migrations safety checks, which should only be used when you're certain the operation is safe and have documented why it's necessary.
Constant Summary collapse
- MSG =
'Avoid `safety_assured` in migrations. It bypasses strong_migrations safety checks. ' \ 'Ensure this operation is truly safe, consider safer alternatives, and document why ' \ 'safety_assured is necessary.'
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ Object
52 53 54 55 56 |
# File 'lib/rubocop/cop/dutchie/migration_safety_assured.rb', line 52 def on_block(node) return unless safety_assured_block?(node) add_offense(node) end |