Class: ActiveRecord::Migration::ReversibleBlockHelper

Inherits:
Struct
  • Object
show all
Defined in:
activerecord/lib/active_record/migration.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Struct

#as_json

Instance Attribute Details

#revertingObject

Returns the value of attribute reverting

Returns:

  • (Object)

    the current value of reverting



804
805
806
# File 'activerecord/lib/active_record/migration.rb', line 804

def reverting
  @reverting
end

Instance Method Details

#downObject



809
810
811
# File 'activerecord/lib/active_record/migration.rb', line 809

def down
  yield if reverting
end

#upObject



805
806
807
# File 'activerecord/lib/active_record/migration.rb', line 805

def up
  yield unless reverting
end