activerecord/lib/active_record/migration/command_recorder.rb
def revert
        @reverting = !@reverting
        previous = @commands
        @commands = []
        yield
      ensure
        @commands = previous.concat(@commands.reverse)
        @reverting = !@reverting
      end
# While executing the given block, the recorded will be in reverting mode.
# All commands recorded will end up being recorded reverted
# and in reverse order.
# For example:
#
#   recorder.revert{ recorder.record(:rename_table, [:old, :new]) }
#   # same effect as recorder.record(:rename_table, [:new, :old])
While executing the given block, the recorded will be in reverting mode.
All commands recorded will end up being recorded reverted
and in reverse order.
For example.


While executing the given block the recorded will be in reverting mode . All commands recorded will end up being recorded reverted and in reverse order . For example .
def revert
        @reverting = !@reverting
        previous = @commands
        @commands = []
        yield
      ensure
        @commands = previous.concat(@commands.reverse)
        @reverting = !@reverting
      end
def revert @reverting = ! @reverting previous = @commands @commands = [ ] yield ensure @commands = previous . concat ( @commands . reverse ) @reverting = ! @reverting end
While executing the given block, the recorded will be in reverting mode.
While executing the given block the recorded will be in reverting mode .