123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::Transaction::Callback

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: activerecord/lib/active_record/connection_adapters/abstract/transaction.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(event, callback) ⇒ Callback

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 130

def initialize(event, callback)
  @event = event
  @callback = callback
end

Instance Method Details

#after_commit

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 139

def after_commit
  @callback.call if @event == :after_commit
end

#after_rollback

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 143

def after_rollback
  @callback.call if @event == :after_rollback
end

#before_commit

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 135

def before_commit
  @callback.call if @event == :before_commit
end