Sha256: a64ada0b5c2324cd42dce0de93fff865228595358c8b3dff40893669bf9c69e6

Contents?: true

Size: 422 Bytes

Versions: 12

Compression:

Stored size: 422 Bytes

Contents

# frozen_string_literal: true

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

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.6.4 lib/rom/sql/transaction.rb
rom-sql-3.6.3 lib/rom/sql/transaction.rb
rom-sql-3.6.2 lib/rom/sql/transaction.rb
rom-sql-3.6.1 lib/rom/sql/transaction.rb
rom-sql-3.6.0 lib/rom/sql/transaction.rb
rom-sql-3.5.0 lib/rom/sql/transaction.rb
rom-sql-3.4.0 lib/rom/sql/transaction.rb
rom-sql-3.3.3 lib/rom/sql/transaction.rb
rom-sql-3.3.2 lib/rom/sql/transaction.rb
rom-sql-3.3.1 lib/rom/sql/transaction.rb
rom-sql-3.3.0 lib/rom/sql/transaction.rb
rom-sql-3.2.0 lib/rom/sql/transaction.rb