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-12.0.0.beta.4 lib/active_graph/transaction.rb
activegraph-11.5.0.beta.3 lib/active_graph/transaction.rb
activegraph-12.0.0.beta.3 lib/active_graph/transaction.rb
activegraph-12.0.0.beta.2 lib/active_graph/transaction.rb
activegraph-11.5.0.beta.2 lib/active_graph/transaction.rb
activegraph-12.0.0.beta.1 lib/active_graph/transaction.rb
activegraph-11.5.0.beta.1 lib/active_graph/transaction.rb
activegraph-11.5.0.alpha.1 lib/active_graph/transaction.rb
activegraph-11.4.0 lib/active_graph/transaction.rb
activegraph-11.3.1 lib/active_graph/transaction.rb
activegraph-11.3.0 lib/active_graph/transaction.rb
activegraph-11.2.0 lib/active_graph/transaction.rb
activegraph-11.1.0 lib/active_graph/transaction.rb
activegraph-11.1.0.beta.1 lib/active_graph/transaction.rb
activegraph-11.1.0.alpha.4 lib/active_graph/transaction.rb
activegraph-11.1.0.alpha.3 lib/active_graph/transaction.rb
activegraph-11.1.0.alpha.2 lib/active_graph/transaction.rb
activegraph-11.1.0.alpha.1 lib/active_graph/transaction.rb
activegraph-11.0.2-java lib/active_graph/transaction.rb
activegraph-11.0.1-java lib/active_graph/transaction.rb