Module: ActiveRecordShards::Tasks
- Defined in:
- lib/active_record_shards/tasks.rb
Class Method Summary collapse
Class Method Details
.root_connection(conf) ⇒ Object
94 95 96 97 98 99 100 101 102 |
# File 'lib/active_record_shards/tasks.rb', line 94 def root_connection(conf) conf = conf.merge('database' => nil) spec = spec_for(conf) if "#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}" == '6.1' ActiveRecord::Base.send("#{conf['adapter']}_connection", spec.db_config.configuration_hash) else ActiveRecord::Base.send("#{conf['adapter']}_connection", spec.config) end end |