Module: ActiveRecordCompose::TransactionSupport
- Extended by:
- ActiveSupport::Concern
- Included in:
- Model
- Defined in:
- lib/active_record_compose/transaction_support.rb,
lib/active_record_compose/transaction_support/active_transaction.rb,
lib/active_record_compose/transaction_support/transaction_coordinator.rb
Defined Under Namespace
Classes: ActiveTransaction
Class Method Summary collapse
-
.after_commit(*args, &block) ⇒ void
Registers a block to be called after the transaction is fully committed.
-
.after_rollback(*args, &block) ⇒ void
Registers a block to be called after the transaction is rolled back.
Instance Method Summary collapse
Class Method Details
.after_commit(*args, &block) ⇒ void
Registers a block to be called after the transaction is fully committed.
53 54 55 56 |
# File 'lib/active_record_compose/transaction_support.rb', line 53 def after_commit(*args, &block) (args, prepend_option) set_callback(:commit, :after, *args, &block) end |
.after_rollback(*args, &block) ⇒ void
Registers a block to be called after the transaction is rolled back.
60 61 62 63 |
# File 'lib/active_record_compose/transaction_support.rb', line 60 def after_rollback(*args, &block) (args, prepend_option) set_callback(:rollback, :after, *args, &block) end |
Instance Method Details
#save(**options) ⇒ void
105 |
# File 'lib/active_record_compose/transaction_support.rb', line 105 def save(**) = with_transaction_returning_status { super } |
#save!(**options) ⇒ void
107 |
# File 'lib/active_record_compose/transaction_support.rb', line 107 def save!(**) = with_transaction_returning_status { super } |