module StrongMigrations::Migration
Public Instance Methods
method_missing(method, *args)
click to toggle source
Calls superclass method
# File lib/strong_migrations/migration.rb, line 9 def method_missing(method, *args) return super if is_a?(ActiveRecord::Schema) strong_migrations_checker.perform(method, *args) do super end end
migrate(direction)
click to toggle source
Calls superclass method
# File lib/strong_migrations/migration.rb, line 3 def migrate(direction) strong_migrations_checker.direction = direction super connection.begin_db_transaction if strong_migrations_checker.transaction_disabled end
safety_assured() { || ... }
click to toggle source
# File lib/strong_migrations/migration.rb, line 18 def safety_assured strong_migrations_checker.safety_assured do yield end end
stop!(message, header: "Custom check")
click to toggle source
# File lib/strong_migrations/migration.rb, line 24 def stop!(message, header: "Custom check") raise StrongMigrations::UnsafeMigration, "\n=== #{header} #strong_migrations ===\n\n#{message}\n" end
Private Instance Methods
strong_migrations_checker()
click to toggle source
# File lib/strong_migrations/migration.rb, line 30 def strong_migrations_checker @strong_migrations_checker ||= StrongMigrations::Checker.new(self) end