Class: ROM::SQL::Transaction Private

Inherits:
Transaction
  • Object
show all
Defined in:
lib/rom/sql/transaction.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ Transaction

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Transaction.



12
13
14
# File 'lib/rom/sql/transaction.rb', line 12

def initialize(connection)
  @connection = connection
end

Instance Method Details

#run(**options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



16
17
18
19
20
# File 'lib/rom/sql/transaction.rb', line 16

def run(**options)
  connection.transaction(options) { yield(self) }
rescue ::ROM::Transaction::Rollback
  # noop
end