Module: ActiveGraph::Transaction

Defined in:
lib/active_graph/transaction.rb

Instance Method Summary collapse

Instance Method Details

#after_commit(&block) ⇒ Object


8
9
10
# File 'lib/active_graph/transaction.rb', line 8

def after_commit(&block)
  after_commit_registry << block
end

#apply_callbacksObject


12
13
14
# File 'lib/active_graph/transaction.rb', line 12

def apply_callbacks
  after_commit_registry.each(&:call) unless @rolled_back
end

#rollbackObject


3
4
5
6
# File 'lib/active_graph/transaction.rb', line 3

def rollback
  super
  @rolled_back = true
end