Sha256: e0e65c0b1ae805d64ef2af157464257b1e66462c845e7a545045830a4ea1d2c8
Contents?: true
Size: 1003 Bytes
Versions: 27
Compression:
Stored size: 1003 Bytes
Contents
# frozen_string_literal: true module ArJdbc ConnectionMethods = ::ActiveRecord::ConnectionHandling ConnectionMethods.module_eval do def jdbc_connection(config) adapter_class = config[:adapter_class] || ::ActiveRecord::ConnectionAdapters::JdbcAdapter adapter_class.new(nil, logger, nil, 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 # @note keeps the same Hash when possible - helps caching on native side def symbolize_keys_if_necessary(hash) symbolize = false hash.each_key do |key| if ! key.is_a?(Symbol) && key.respond_to?(:to_sym) symbolize = true; break end end symbolize ? hash.symbolize_keys : hash end end end
Version data entries
27 entries across 27 versions & 2 rubygems