命名空間
- 模組 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