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
Instance Method Summary collapse
-
#initialize ⇒ MigrationAlterTableReverser
constructor
A new instance of MigrationAlterTableReverser.
- #reverse(&block) ⇒ Object
Methods inherited from BasicObject
const_missing, remove_methods!
Constructor Details
#initialize ⇒ MigrationAlterTableReverser
Returns a new instance of MigrationAlterTableReverser.
225 226 227 |
# File 'lib/sequel/extensions/migration.rb', line 225 def initialize @actions = [] end |
Instance Method Details
#reverse(&block) ⇒ Object
229 230 231 232 233 |
# File 'lib/sequel/extensions/migration.rb', line 229 def reverse(&block) instance_eval(&block) actions = @actions.reverse Proc.new{actions.each{|a| send(*a)}} end |