Custom Database adapters


#1

Hi. I’ve created a custom database adapter, but I’d like to modify the
RAILS_CONNECTION_ADAPTERS variable, and add the adapter in my rails app
rather than modifying the activerecord directory.

Does anyone know how to do this, or can point me to info online? Thank
you.

–Aaron


#2

Hello Aaron,

Hi. I’ve created a custom database adapter, but I’d like to modify the
RAILS_CONNECTION_ADAPTERS variable, and add the adapter
in my rails app
rather than modifying the activerecord directory.

Have you tried to define RAILS_CONNECTION_ADAPTERS
in config/environment.rb ?

sth like :


RAILS_CONNECTION_ADAPTERS = %w(mysql my_custom_adapter)

Rails::Initializer.run do |config|

Just my 2 (euro)cents,

РJean-Fran̤ois.