class Sequel::MigrationAlterTableReverser

  1. lib/sequel/extensions/migration.rb
Superclass: BasicObject

Handles reversing an alter_table block in a reversible migration.

Methods

Public Class

  1. new

Public Instance

  1. reverse

Public Class methods

new ()
[show source]
# File lib/sequel/extensions/migration.rb, line 228
def initialize
  @actions = []
end

Public Instance methods

reverse (&block)
[show source]
# File lib/sequel/extensions/migration.rb, line 232
def reverse(&block)
  instance_exec(&block)
  actions = @actions.reverse
  # Allow calling private methods as the reversing methods are private
  Proc.new{actions.each{|a| send(*a)}}
end