Module: InteractorSupport::Concerns::Transactionable
- Extended by:
- ActiveSupport::Concern
- Includes:
- InteractorSupport::Core
- Defined in:
- lib/interactor_support/concerns/transactionable.rb
Overview
Adds transactional support to your interactor using ActiveRecord.
The transaction
method wraps the interactor execution in an around
block
that uses ActiveRecord::Base.transaction
. If the context fails (via context.fail!
),
the transaction is rolled back automatically using ActiveRecord::Rollback
.
This is useful for ensuring your interactor behaves atomically.