From 3a6770fb512572bec904c0d710dc3d0954edcafa Mon Sep 17 00:00:00 2001 From: eileencodes Date: Thu, 19 Dec 2019 12:25:39 -0500 Subject: [PATCH] Add CHANGELOG for #38029 --- activerecord/CHANGELOG.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 1c8b726c0b..e6b2c42bd7 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,24 @@ +* Don't allow mutations on the datbase configurations hash. + + Freeze the configurations hash to disallow directly changing the configurations hash. If applications need to change the hash, for example to create adatabases for parallelization, they should use the `DatabaseConfig` object directly. + + Before: + + ```ruby + @db_config = ActiveRecord::Base.configurations.configs_for(env_name: "test", spec_name: "primary") + @db_config.configuration_hash.merge!(idle_timeout: "0.02") + ``` + + After: + + ```ruby + @db_config = ActiveRecord::Base.configurations.configs_for(env_name: "test", spec_name: "primary") + config = @db_config.configuration_hash.merge(idle_timeout: "0.02") + db_config = ActiveRecord::DatabaseConfigurations::HashConfig.new(@db_config.env_name, @db_config.spec_name, config) + ``` + + *Eileen M. Uchitelle*, *John Crepezzi* + * Remove `:connection_id` from the `sql.active_record` notification. *Aaron Patterson*, *Rafael Mendonça França*