命名空间
- 模块 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
- 类 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
方法
- R
类公共方法
register(name, class_name, path = class_name.underscore) 链接
注册自定义数据库适配器。
也可以用来定义别名。
示例
ActiveRecord::ConnectionAdapters.register("megadb", "MegaDB::ActiveRecordAdapter", "mega_db/active_record_adapter")
ActiveRecord::ConnectionAdapters.register("mysql", "ActiveRecord::ConnectionAdapters::TrilogyAdapter", "active_record/connection_adapters/trilogy_adapter")
来源: 显示 | 在 GitHub 上
# 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