Class: Sequel::MigrationAlterTableReverser

Inherits:
BasicObject
Defined in:
lib/sequel/extensions/migration.rb

Overview

Handles reversing an alter_table block in a reversible migration.

Constant Summary

Constants inherited from BasicObject

BasicObject::KEEP_METHODS

Instance Method Summary collapse

Methods inherited from BasicObject

const_missing, remove_methods!

Constructor Details

#initializeMigrationAlterTableReverser

Returns a new instance of MigrationAlterTableReverser.



231
232
233
# File 'lib/sequel/extensions/migration.rb', line 231

def initialize
  @actions = []
end

Instance Method Details

#reverse(&block) ⇒ Object



235
236
237
238
239
# File 'lib/sequel/extensions/migration.rb', line 235

def reverse(&block)
  instance_eval(&block)
  actions = @actions.reverse
  Proc.new{actions.each{|a| send(*a)}}
end