method

within_new_transaction

rails latest stable - Class: ActiveRecord::ConnectionAdapters::DatabaseStatements

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.1.8) is shown here.

within_new_transaction(options = {})
public

No documentation available.

# File activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb, line 207
      def within_new_transaction(options = {}) #:nodoc:
        transaction = begin_transaction(options)
        yield
      rescue Exception => error
        rollback_transaction if transaction
        raise
      ensure
        begin
          commit_transaction unless error
        rescue Exception
          rollback_transaction
          raise
        end
      end