Module: ActiveGraph::Transaction

Defined in:
lib/active_graph/transaction.rb

Instance Method Summary collapse

Instance Method Details

#after_commit(&block) ⇒ Object



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

def after_commit(&block)
  after_commit_registry << block
end

#apply_callbacksObject



15
16
17
# File 'lib/active_graph/transaction.rb', line 15

def apply_callbacks
  after_commit_registry.each(&:call)
end

#check_rollbackObject



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

def check_rollback
  fail ActiveGraph::Rollback if @active_graph_rolled_back
end

#rollbackObject



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

def rollback
  @active_graph_rolled_back = true
end