Sha256: 52f6c778b4a89ff7eedeefcb930446a462d819a832caa308a02c6f9fee4cb7a3
Contents?: true
Size: 497 Bytes
Versions: 15
Compression:
Stored size: 497 Bytes
Contents
module Neo4j module Core module TxMethods def tx_methods(*methods) methods.each do |method| tx_method = "#{method}_in_tx" send(:alias_method, tx_method, method) send(:define_method, method) do |*args, &block| session = args.last.is_a?(Neo4j::Session) ? args.pop : Neo4j::Session.current! Neo4j::Transaction.run(session.auto_commit?) { send(tx_method, *args, &block) } end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems