Class: ActiveRecord::ConnectionAdapters::RealTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- ActiveRecord::ConnectionAdapters::RealTransaction
- Defined in:
- lib/active_record/connection_adapters/abstract/transaction.rb
Instance Attribute Summary
Attributes inherited from Transaction
#connection, #joinable, #records, #savepoint_name, #state
Instance Method Summary collapse
- #commit ⇒ Object
-
#initialize(connection, options, *args) ⇒ RealTransaction
constructor
A new instance of RealTransaction.
- #rollback ⇒ Object
Methods inherited from Transaction
#add_record, #before_commit_records, #closed?, #commit_records, #full_rollback?, #joinable?, #open?, #rollback_records
Constructor Details
#initialize(connection, options, *args) ⇒ RealTransaction
Returns a new instance of RealTransaction.
161 162 163 164 165 166 167 168 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 161 def initialize(connection, , *args) super if [:isolation] connection.begin_isolated_db_transaction([:isolation]) else connection.begin_db_transaction end end |
Instance Method Details
#commit ⇒ Object
175 176 177 178 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 175 def commit connection.commit_db_transaction super end |
#rollback ⇒ Object
170 171 172 173 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 170 def rollback connection.rollback_db_transaction super end |