Sha256: 5a81085ec2f3d47b1e2990417a0fd457029be6db1b1bc1e1f6de034a7e01b342

Contents?: true

Size: 789 Bytes

Versions: 19

Compression:

Stored size: 789 Bytes

Contents

module ArJdbc
  if ActiveRecord.const_defined? :ConnectionHandling # 4.0
    ConnectionMethods = ActiveRecord::ConnectionHandling
  else # 3.x
    ConnectionMethods = (class << ActiveRecord::Base; self; end)
  end
  ConnectionMethods.module_eval do

    def jdbc_connection(config)
      adapter_class = config[:adapter_class]
      adapter_class ||= ::ActiveRecord::ConnectionAdapters::JdbcAdapter
      adapter_class.new(nil, logger, config)
    end

    def jndi_connection(config); jdbc_connection(config) end

    def embedded_driver(config)
      config[:username] ||= "sa"
      config[:password] ||= ""
      jdbc_connection(config)
    end

    private

    def jndi_config?(config)
      ::ActiveRecord::ConnectionAdapters::JdbcConnection.jndi_config?(config)
    end

  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
activerecord-jdbc-adapter-1.3.25 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.24 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.23 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.22 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.21 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.20 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.19 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.18 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.17 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.16 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.15 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.14 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.13 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.12 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.11 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.10 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.9 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.8 lib/arjdbc/jdbc/connection_methods.rb
activerecord-jdbc-adapter-1.3.7 lib/arjdbc/jdbc/connection_methods.rb