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.
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 |