Sha256: 580397ed0783efbf951458f7cb56e908e232f0a2f19b867ee5b48693f8c37762

Contents?: true

Size: 391 Bytes

Versions: 35

Compression:

Stored size: 391 Bytes

Contents

module ROM
  module SQL
    # @api private
    class Transaction < ::ROM::Transaction
      attr_reader :connection
      private :connection

      def initialize(connection)
        @connection = connection
      end

      def run(opts = EMPTY_HASH)
        connection.transaction(opts) { yield(self) }
      rescue ::ROM::Transaction::Rollback
        # noop
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/transaction.rb
rom-sql-3.0.1 lib/rom/sql/transaction.rb
rom-sql-3.0.0 lib/rom/sql/transaction.rb
rom-sql-2.5.0 lib/rom/sql/transaction.rb
rom-sql-2.4.0 lib/rom/sql/transaction.rb
rom-sql-2.3.0 lib/rom/sql/transaction.rb
rom-sql-2.2.1 lib/rom/sql/transaction.rb
rom-sql-2.2.0 lib/rom/sql/transaction.rb
rom-sql-2.1.0 lib/rom/sql/transaction.rb
rom-sql-2.0.0 lib/rom/sql/transaction.rb
rom-sql-1.3.5 lib/rom/sql/transaction.rb
rom-sql-2.0.0.rc1 lib/rom/sql/transaction.rb
rom-sql-1.3.4 lib/rom/sql/transaction.rb
rom-sql-2.0.0.beta3 lib/rom/sql/transaction.rb
rom-sql-2.0.0.beta2 lib/rom/sql/transaction.rb
rom-sql-2.0.0.beta1 lib/rom/sql/transaction.rb
rom-sql-1.3.3 lib/rom/sql/transaction.rb
rom-sql-1.3.2 lib/rom/sql/transaction.rb
rom-sql-1.3.1 lib/rom/sql/transaction.rb
rom-sql-1.3.0 lib/rom/sql/transaction.rb