Remove deprecated `DatabaseConfig#config` method
This commit is contained in:
parent
15aa4200e0
commit
7b9d4d2d8a
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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+.
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue