Class: ActiveRecord::Migration::ReversibleBlockHelper

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/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



752
753
754
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb', line 752

def reverting
  @reverting
end

Instance Method Details

#downObject



757
758
759
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb', line 757

def down
  yield if reverting
end

#upObject



753
754
755
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb', line 753

def up
  yield unless reverting
end