Module: ActiveRecord::ConnectionHandling
- Defined in:
- lib/active_record/connection_adapters/db_mariadb_adapter.rb,
lib/active_record/connection_adapters/db_postgres_adapter.rb
Instance Method Summary collapse
Instance Method Details
#db_mariadb_connection(config) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/active_record/connection_adapters/db_mariadb_adapter.rb', line 10 def db_mariadb_connection(config) config = config.symbolize_keys.compact config.delete(:adapter) adapter = DB::MariaDB::Adapter.new(**config) return DB::ActiveRecord::Adapter::MariaDB.new(adapter, config) end |
#db_postgres_connection(config) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/active_record/connection_adapters/db_postgres_adapter.rb', line 11 def db_postgres_connection(config) config = config.symbolize_keys.compact config.delete(:adapter) adapter = DB::Postgres::Adapter.new(**config) return DB::ActiveRecord::Adapter::Postgres.new(adapter, config) end |