diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 8f835e56bd..164821702f 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated `DatabaseConfig#config` method. + + *Rafael Mendonça França* + * Rollback transactions when the block returns earlier than expected. Before this change, when a transaction block returned early, the transaction would be committed. diff --git a/activerecord/lib/active_record/database_configurations/database_config.rb b/activerecord/lib/active_record/database_configurations/database_config.rb index aeb22993f8..163fc6bbe3 100644 --- a/activerecord/lib/active_record/database_configurations/database_config.rb +++ b/activerecord/lib/active_record/database_configurations/database_config.rb @@ -20,10 +20,6 @@ module ActiveRecord end deprecate spec_name: "please use name instead" - def config - raise NotImplementedError - end - def adapter_method "#{adapter}_connection" end diff --git a/activerecord/lib/active_record/database_configurations/hash_config.rb b/activerecord/lib/active_record/database_configurations/hash_config.rb index afa44595e7..af5f2e43f4 100644 --- a/activerecord/lib/active_record/database_configurations/hash_config.rb +++ b/activerecord/lib/active_record/database_configurations/hash_config.rb @@ -32,11 +32,6 @@ module ActiveRecord @configuration_hash = configuration_hash.symbolize_keys.freeze end - def config - ActiveSupport::Deprecation.warn("DatabaseConfig#config will be removed in 7.0.0 in favor of DatabaseConfig#configuration_hash which returns a hash with symbol keys") - configuration_hash.stringify_keys - end - # Determines whether a database configuration is for a replica / readonly # connection. If the +replica+ key is present in the config, +replica?+ will # return +true+. diff --git a/activerecord/test/cases/database_configurations_test.rb b/activerecord/test/cases/database_configurations_test.rb index c4f0ef4d62..ef975bca4d 100644 --- a/activerecord/test/cases/database_configurations_test.rb +++ b/activerecord/test/cases/database_configurations_test.rb @@ -115,12 +115,6 @@ class LegacyDatabaseConfigurationsTest < ActiveRecord::TestCase end end - def test_deprecated_config_method - db_config = ActiveRecord::Base.configurations.configs_for(env_name: "arunit", name: "primary") - - assert_equal db_config.configuration_hash.stringify_keys, assert_deprecated { db_config.config } - end - def test_unsupported_method_raises assert_raises NoMethodError do ActiveRecord::Base.configurations.fetch(:foo) diff --git a/guides/source/7_0_release_notes.md b/guides/source/7_0_release_notes.md index 1a8786fc62..93823f4fab 100644 --- a/guides/source/7_0_release_notes.md +++ b/guides/source/7_0_release_notes.md @@ -124,6 +124,8 @@ Please refer to the [Changelog][active-record] for detailed changes. * Remove deprecated support to pass a column to `type_cast`. +* Remove deprecated `DatabaseConfig#config` method. + ### Deprecations ### Notable changes