Namespace
Module
- ActiveRecord::ConnectionAdapters::ColumnMethods
- ActiveRecord::ConnectionAdapters::DatabaseLimits
- ActiveRecord::ConnectionAdapters::DatabaseStatements
- ActiveRecord::ConnectionAdapters::Deduplicable
- ActiveRecord::ConnectionAdapters::MySQL
- ActiveRecord::ConnectionAdapters::Mysql2
- ActiveRecord::ConnectionAdapters::PostgreSQL
- ActiveRecord::ConnectionAdapters::QueryCache
- ActiveRecord::ConnectionAdapters::Quoting
- ActiveRecord::ConnectionAdapters::SQLite3
- ActiveRecord::ConnectionAdapters::Savepoints
- ActiveRecord::ConnectionAdapters::SchemaStatements
- ActiveRecord::ConnectionAdapters::Trilogy
Class
- ActiveRecord::ConnectionAdapters::AbstractAdapter
- ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
- ActiveRecord::ConnectionAdapters::BoundSchemaReflection
- ActiveRecord::ConnectionAdapters::Column
- ActiveRecord::ConnectionAdapters::ConnectionHandler
- ActiveRecord::ConnectionAdapters::ConnectionPool
- ActiveRecord::ConnectionAdapters::Mysql2Adapter
- ActiveRecord::ConnectionAdapters::NullColumn
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
- ActiveRecord::ConnectionAdapters::RealTransaction
- ActiveRecord::ConnectionAdapters::RestartParentTransaction
- ActiveRecord::ConnectionAdapters::SQLite3Adapter
- ActiveRecord::ConnectionAdapters::SavepointTransaction
- ActiveRecord::ConnectionAdapters::SchemaCache
- ActiveRecord::ConnectionAdapters::SchemaReflection
- ActiveRecord::ConnectionAdapters::SqlTypeMetadata
- ActiveRecord::ConnectionAdapters::Table
- ActiveRecord::ConnectionAdapters::TableDefinition
- ActiveRecord::ConnectionAdapters::TransactionInstrumenter
- ActiveRecord::ConnectionAdapters::TransactionState
- ActiveRecord::ConnectionAdapters::TrilogyAdapter
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