lib/neo4j/transaction.rb in neo4j-10.0.0.pre.alpha.4 vs lib/neo4j/transaction.rb in neo4j-10.0.0.pre.alpha.5
- old
+ new
@@ -27,16 +27,19 @@
ensure
tx.close unless tx.nil?
end
def root
- stack.first
+ initialized_stack.first
end
+
+ def initialized_stack
+ self.stack ||= []
+ end
end
def initialize(_options = {})
- (self.stack ||= []) << self
-
+ self.class.initialized_stack << self
@root = stack.first
return unless root?
@driver_session = ActiveBase.current_driver.driver.session(Neo4j::Driver::AccessMode::WRITE)
@driver_tx = @driver_session.begin_transaction
rescue StandardError => e