Class: ActiveRecord::ConnectionAdapters::TransactionInstrumenter
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::TransactionInstrumenter
- Defined in:
- lib/active_record/connection_adapters/abstract/transaction.rb
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(payload = {}) ⇒ TransactionInstrumenter
constructor
A new instance of TransactionInstrumenter.
- #start ⇒ Object
Constructor Details
#initialize(payload = {}) ⇒ TransactionInstrumenter
Returns a new instance of TransactionInstrumenter.
78 79 80 81 82 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 78 def initialize(payload = {}) @handle = nil @started = false @payload = payload end |
Instance Method Details
#finish ⇒ Object
92 93 94 95 96 97 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 92 def finish return unless @started @started = false @handle.finish end |
#start ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 84 def start return if @started @started = true @handle = ActiveSupport::Notifications.instrumenter.build_handle("transaction.active_record", @payload) @handle.start end |