Sha256: 03b1a5e44e4748b7ab8edc68a4522d16d81af5efec77efb38b391643c267d894

Contents?: true

Size: 600 Bytes

Versions: 32

Compression:

Stored size: 600 Bytes

Contents

require 'database_cleaner/neo4j/base'
require 'database_cleaner/generic/transaction'
require 'neo4j-core'

module DatabaseCleaner
  module Neo4j
    class Transaction
      include ::DatabaseCleaner::Generic::Transaction
      include ::DatabaseCleaner::Neo4j::Base

      attr_accessor :tx

      def start
        super
        rollback
        self.tx = ::Neo4j::Transaction.new
      end

      def clean
        rollback
      end

      private

      def rollback
        if tx
          tx.failure
          tx.close
        end
      ensure
        self.tx = nil
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 4 rubygems

Version Path
database_cleaner-1.99.0 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.99.0.beta adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-neo4j-1.99.0.beta lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.5 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.4 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.3 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.2 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.1 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.0 adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-neo4j-1.8.0 lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.8.0.beta adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/transaction.rb
database_cleaner-neo4j-1.8.0.beta lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.7.0 lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.6.2 lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.6.1 lib/database_cleaner/neo4j/transaction.rb
database_cleaner-1.6.0 lib/database_cleaner/neo4j/transaction.rb
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/neo4j/transaction.rb
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/neo4j/transaction.rb
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/neo4j/transaction.rb
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/database_cleaner-1.5.3/lib/database_cleaner/neo4j/transaction.rb