Namespace

Module

Class

Methods

Class Public methods

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")
📝 Source code
# 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
🔎 See on GitHub