Module: ActiveRecord::ConnectionAdapters
Class Method Summary
-
.register(name, class_name, path = class_name.underscore)
Registers a custom database adapter.
::ActiveSupport::Autoload
- Extended
Class Method Details
.register(name, class_name, path = class_name.underscore)
Registers a custom database adapter.
Can also be used to define aliases.
Example
ActiveRecord::ConnectionAdapters.register("megadb", "MegaDB::ActiveRecordAdapter", "mega_db/active_record_adapter")
ActiveRecord::ConnectionAdapters.register("mysql", "ActiveRecord::ConnectionAdapters::TrilogyAdapter", "active_record/connection_adapters/trilogy_adapter")
# File 'activerecord/lib/active_record/connection_adapters.rb', line 22
def register(name, class_name, path = class_name.underscore) @adapters[name.to_s] = [class_name, path] end