Module: ActiveGraph::Transaction
- Defined in:
- lib/active_graph/transaction.rb
Instance Method Summary collapse
- #after_commit(&block) ⇒ Object
- #apply_callbacks ⇒ Object
- #check_rollback ⇒ Object
- #rollback ⇒ Object
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_callbacks ⇒ Object
15 16 17 |
# File 'lib/active_graph/transaction.rb', line 15 def apply_callbacks after_commit_registry.each(&:call) end |
#check_rollback ⇒ Object
7 8 9 |
# File 'lib/active_graph/transaction.rb', line 7 def check_rollback fail ActiveGraph::Rollback if @active_graph_rolled_back end |
#rollback ⇒ Object
3 4 5 |
# File 'lib/active_graph/transaction.rb', line 3 def rollback @active_graph_rolled_back = true end |