Module: ActiveGraph::Transaction

Defined in:
lib/active_graph/transaction.rb

Instance Method Summary collapse

Instance Method Details

#after_commit(&block) ⇒ Object



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

def after_commit(&block)
  after_commit_registry << block
end

#apply_callbacksObject



17
18
19
# File 'lib/active_graph/transaction.rb', line 17

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

#closeObject



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

def close
  success
  super
end

#failureObject



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

def failure
  super
  @failure = true
end