From d0e2a7fca661be7c0e871cd954cc47a3154737d7 Mon Sep 17 00:00:00 2001 From: Amy Lin <94405478+amy-hs@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:39:27 -0800 Subject: [PATCH] Update to use configs_for --- lib/knockoff/config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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