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, #to_h

Instance Attribute Details

#revertingObject

Returns the value of attribute reverting

Returns:

  • (Object)

    the current value of reverting



472
473
474
# File 'activerecord/lib/active_record/migration.rb', line 472

def reverting
  @reverting
end

Instance Method Details

#downObject



477
478
479
# File 'activerecord/lib/active_record/migration.rb', line 477

def down
  yield if reverting
end

#upObject



473
474
475
# File 'activerecord/lib/active_record/migration.rb', line 473

def up
  yield unless reverting
end