Module: Journaled::TransactionExt
- Defined in:
- lib/journaled/transaction_ext.rb
Instance Method Summary collapse
- #_journaled_staged_events ⇒ Object
- #before_commit_records ⇒ Object
- #commit_records ⇒ Object
- #initialize ⇒ Object
Instance Method Details
#_journaled_staged_events ⇒ Object
| 27 28 29 | # File 'lib/journaled/transaction_ext.rb', line 27 def _journaled_staged_events @_journaled_staged_events ||= [] end | 
#before_commit_records ⇒ Object
| 16 17 18 19 20 | # File 'lib/journaled/transaction_ext.rb', line 16 def before_commit_records super.tap do Writer.enqueue!(*_journaled_staged_events) if @run_commit_callbacks end end | 
#commit_records ⇒ Object
| 22 23 24 25 | # File 'lib/journaled/transaction_ext.rb', line 22 def commit_records connection.current_transaction._journaled_staged_events.push(*_journaled_staged_events) unless @run_commit_callbacks super end | 
#initialize ⇒ Object
| 5 6 7 8 9 10 11 12 13 14 | # File 'lib/journaled/transaction_ext.rb', line 5 def initialize(*, **) super.tap do raise TransactionSafetyError, <<~MSG unless instance_variable_defined?(:@run_commit_callbacks) Journaled::TransactionExt expects @run_commit_callbacks to be defined on Transaction! This is an internal API that may have changed in a recent Rails release. If you were not expecting to see this error, please file an issue here: https://github.com/Betterment/journaled/issues MSG end end |