Skip to content

Commit 7b9d4d2

Browse files
committed
Remove deprecated DatabaseConfig#config method
1 parent 15aa420 commit 7b9d4d2

File tree

5 files changed

+6
-15
lines changed

5 files changed

+6
-15
lines changed

activerecord/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
* Remove deprecated `DatabaseConfig#config` method.
2+
3+
*Rafael Mendonça França*
4+
15
* Rollback transactions when the block returns earlier than expected.
26

37
Before this change, when a transaction block returned early, the transaction would be committed.

activerecord/lib/active_record/database_configurations/database_config.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ def spec_name
2020
end
2121
deprecate spec_name: "please use name instead"
2222

23-
def config
24-
raise NotImplementedError
25-
end
26-
2723
def adapter_method
2824
"#{adapter}_connection"
2925
end

activerecord/lib/active_record/database_configurations/hash_config.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ def initialize(env_name, name, configuration_hash)
3232
@configuration_hash = configuration_hash.symbolize_keys.freeze
3333
end
3434

35-
def config
36-
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")
37-
configuration_hash.stringify_keys
38-
end
39-
4035
# Determines whether a database configuration is for a replica / readonly
4136
# connection. If the +replica+ key is present in the config, +replica?+ will
4237
# return +true+.

activerecord/test/cases/database_configurations_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,6 @@ def test_can_turn_configurations_into_a_hash_and_is_deprecated
115115
end
116116
end
117117

118-
def test_deprecated_config_method
119-
db_config = ActiveRecord::Base.configurations.configs_for(env_name: "arunit", name: "primary")
120-
121-
assert_equal db_config.configuration_hash.stringify_keys, assert_deprecated { db_config.config }
122-
end
123-
124118
def test_unsupported_method_raises
125119
assert_raises NoMethodError do
126120
ActiveRecord::Base.configurations.fetch(:foo)

guides/source/7_0_release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
124124

125125
* Remove deprecated support to pass a column to `type_cast`.
126126

127+
* Remove deprecated `DatabaseConfig#config` method.
128+
127129
### Deprecations
128130

129131
### Notable changes

0 commit comments

Comments
 (0)