Class: RuboCop::Migration::StrongMigrationsChecker
- Inherits:
-
Object
- Object
- RuboCop::Migration::StrongMigrationsChecker
- Includes:
- StrongMigrations::Migration
- Defined in:
- lib/rubocop/migration/strong_migrations_checker.rb
Constant Summary collapse
- SAFETY_ASSURED_WARNINGS =
StrongMigrations raises errors for potentially unsafe code, and relies on the user to add a ‘safety_assured { }` block to supress this warning. These warnings are unsupported by rubocop-migration for now.
[ :add_column_json, :add_index_columns, :change_table, :execute, :remove_column, ].freeze
Instance Method Summary collapse
Instance Method Details
#check_operation(method_name, *args) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/rubocop/migration/strong_migrations_checker.rb', line 25 def check_operation(method_name, *args) send(method_name, *args) rescue StrongMigrations::UnsafeMigration => e (e.) rescue NoMethodError # Do nothing, this method is unrecognized by StrongMigrations unsafe # operations and is likely safe. end |
#postgresql? ⇒ Boolean
21 22 23 |
# File 'lib/rubocop/migration/strong_migrations_checker.rb', line 21 def postgresql? true end |
#version_safe? ⇒ Boolean
17 18 19 |
# File 'lib/rubocop/migration/strong_migrations_checker.rb', line 17 def version_safe? false end |