Module: Journaled::Connection
Defined Under Namespace
Modules: TestOnlyBehaviors
Class Method Summary
collapse
#transaction_open?
Class Method Details
.available? ⇒ Boolean
4
5
6
|
# File 'lib/journaled/connection.rb', line 4
def available?
Journaled.transactional_batching_enabled && transaction_open?
end
|
.stage!(event) ⇒ Object
8
9
10
11
12
13
14
|
# File 'lib/journaled/connection.rb', line 8
def stage!(event)
raise TransactionSafetyError, <<~MSG unless transaction_open?
Transaction not available! By default, journaled event batching requires an open database transaction.
MSG
connection.current_transaction._journaled_staged_events << event
end
|