abort_transaction (Transaction::Simple)

    # File lib/transaction/simple.rb, line 232
      def abort_transaction(name = nil)
        raise Transaction::TransactionError, Transaction::Messages[:cannot_abort_no_transaction] if @__transaction_checkpoint__.nil?

        # Check to see if we are trying to abort a transaction that is outside
        # of the current transaction block. Otherwise, raise TransactionAborted
        # if they are the same.
        defined? @__transaction_block__ or @__transaction_block__ = nil
        if @__transaction_block__ and name
          nix = @__transaction_names__.index(name) + 1
          raise Transaction::TransactionError, Transaction::Messages[:cannot_abort_transaction_before_block] if nix < @__transaction_block__

          raise Transaction::TransactionAborted if @__transaction_block__ == nix
        end

        raise Transaction::TransactionAborted if @__transaction_block__ == @__transaction_level__

        if name.nil?
          __abort_transaction(name)
        else
          raise Transaction::TransactionError, Transaction::Messages[:cannot_abort_named_transaction] % name.inspect unless @__transaction_names__.include?(name)
          __abort_transaction(name) while @__transaction_names__.include?(name)
        end

        self
      end