Sha256: 0fdcc4b7528e6f20d820f87622a8c8e841aaf893dd66f95458f21604086fadd0
Contents?: true
Size: 811 Bytes
Versions: 2
Compression:
Stored size: 811 Bytes
Contents
ArJdbc::ConnectionMethods.module_eval do def h2_connection(config) begin require 'jdbc/h2' ::Jdbc::H2.load_driver(:require) if defined?(::Jdbc::H2.load_driver) rescue LoadError # assuming driver.jar is on the class-path end config[:url] ||= begin db = config[:database] if db[0, 4] == 'mem:' || db[0, 5] == 'file:' || db[0, 5] == 'hsql:' "jdbc:h2:#{db}" else "jdbc:h2:file:#{db}" end end config[:driver] ||= defined?(::Jdbc::H2.driver_name) ? ::Jdbc::H2.driver_name : 'org.h2.Driver' config[:adapter_spec] ||= ::ArJdbc::H2 config[:adapter_class] = ActiveRecord::ConnectionAdapters::H2Adapter unless config.key?(:adapter_class) embedded_driver(config) end alias_method :jdbch2_connection, :h2_connection end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
activerecord-jdbc-adapter-1.3.4 | lib/arjdbc/h2/connection_methods.rb |
activerecord-jdbc-adapter-1.3.3 | lib/arjdbc/h2/connection_methods.rb |