method

register

rails latest stable - Class: ActiveRecord::ConnectionAdapters

Method not available on this version

This method is only available on newer versions. The first available version (v7.2.3) is shown here.

register(name, class_name, path = class_name.underscore)
public

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")