diff --git a/lib/knockoff/config.rb b/lib/knockoff/config.rb index 5d29572..d11d0a1 100644 --- a/lib/knockoff/config.rb +++ b/lib/knockoff/config.rb @@ -34,7 +34,7 @@ def replica_env_keys end def update_replica_configs(new_configs) - ActiveRecord::Base.configurations['knockoff_replicas'].merge(new_configs) if ActiveRecord::Base.configurations['knockoff_replicas'].present? + ActiveRecord::Base.configurations.configs_for(env_name: 'knockoff_replicas').merge(new_configs) if ActiveRecord::Base.configurations.configs_for(env_name: 'knockoff_replicas').present? @replicas_configurations.each do |key, _config| update_replica_config(key, new_configs) end