Module: ActiveInteraction::Transactable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Runnable
- Defined in:
- lib/active_interaction/concerns/transactable.rb
Overview
Execute code in a transaction. If ActiveRecord isn’t available, don’t do anything special.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#transaction { ... } ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/active_interaction/concerns/transactable.rb', line 29 def transaction return unless block_given? if self.class.transaction? ActiveRecord::Base.transaction(self.class.) do yield end else yield end end |