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)
  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 16
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 22
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 28
def strong_migrations_checker
  @strong_migrations_checker ||= StrongMigrations::Checker.new(self)
end