Class: ActiveRecord::Migration::ReversibleBlockHelper

Inherits:
Struct
  • Object
show all
Defined in:
lib/migration_revert/ext/migration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#revertingObject

Returns the value of attribute reverting

Returns:

  • (Object)

    the current value of reverting



62
63
64
# File 'lib/migration_revert/ext/migration.rb', line 62

def reverting
  @reverting
end

Instance Method Details

#downObject



67
68
69
# File 'lib/migration_revert/ext/migration.rb', line 67

def down
  yield if reverting
end

#upObject



63
64
65
# File 'lib/migration_revert/ext/migration.rb', line 63

def up
  yield unless reverting
end