Sha256: c74ecc57f28badf49fc1a0d2694556b2bba44f8ec4058569400d7d4e7f8b8107

Contents?: true

Size: 370 Bytes

Versions: 25

Compression:

Stored size: 370 Bytes

Contents

module ActiveGraph
  module Transaction
    def rollback
      super
      @rolled_back = true
    end

    def after_commit(&block)
      after_commit_registry << block
    end

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

    private

    def after_commit_registry
      @after_commit_registry ||= []
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
activegraph-11.0.0-java lib/active_graph/transaction.rb
activegraph-11.0.0.beta.4-java lib/active_graph/transaction.rb
activegraph-11.0.0.beta.3-java lib/active_graph/transaction.rb
activegraph-11.0.0.beta.2-java lib/active_graph/transaction.rb
activegraph-11.0.0.beta.1-java lib/active_graph/transaction.rb