Sha256: 704d884f77f8d722865a422b2c6c93407888944fb464e1cc9382210dbcb038d0

Contents?: true

Size: 437 Bytes

Versions: 32

Compression:

Stored size: 437 Bytes

Contents

module Neo4j
  module Rails
    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|
            Neo4j::Rails::Transaction.running? ? send(tx_method, *args) : Neo4j::Rails::Transaction.run { send(tx_method, *args) }
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
neo4j-1.2.1-java lib/neo4j/rails/tx_methods.rb
neo4j-1.2.0-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.4-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.3-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.2-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.1-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.0-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.0.beta.3-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.0.beta.2-java lib/neo4j/rails/tx_methods.rb
neo4j-1.1.0.beta.1-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.32-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.31-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.30-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.29-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.28-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.27-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.26-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.25-java lib/neo4j/rails/tx_methods.rb
neo4j-1.0.0.beta.24-java lib/neo4j/rails/tx_methods.rb