Class: ActiveRecord::ConnectionAdapters::RestartParentTransaction
Relationships & Source Files | |
Inherits: |
ActiveRecord::ConnectionAdapters::Transaction
|
Defined in: | activerecord/lib/active_record/connection_adapters/abstract/transaction.rb |
Overview
Active Record Restart Parent Transaction
Class Method Summary
Instance Attribute Summary
- #full_rollback? ⇒ Boolean readonly
- #restart readonly
Instance Method Summary
Constructor Details
.new(connection, parent_transaction, **options) ⇒ RestartParentTransaction
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 377
def initialize(connection, parent_transaction, ** ) super(connection, ** ) @parent = parent_transaction if isolation_level raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction" end @parent.state.add_child(@state) end
Instance Attribute Details
#full_rollback? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 400
def full_rollback?; false; end
#restart (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 389
delegate :materialize!, :materialized?, :restart, to: :@parent
Instance Method Details
#commit
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 396
def commit @state.commit! end
#materialize!
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 389
delegate :materialize!, :materialized?, :restart, to: :@parent
#materialized? ⇒ Boolean
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 389
delegate :materialize!, :materialized?, :restart, to: :@parent
#rollback
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 391
def rollback @state.rollback! @parent.restart end