Skip to content

Commit 99b54b6

Browse files
committed
Remove deprecated option :spec_name in the configs_for method
1 parent 5eddf5e commit 99b54b6

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
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 option `:spec_name` in the `configs_for` method.
2+
3+
*Rafael Mendonça França*
4+
15
* Remove deprecated `ActiveRecord::Base.allow_unsafe_raw_sql`.
26

37
*Rafael Mendonça França*

activerecord/lib/active_record/database_configurations.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,7 @@ def initialize(configurations = {})
4141
# hidden by +database_tasks: false+ in the returned list. Most of the time we're only
4242
# iterating over the primary connections (i.e. migrations don't need to run for the
4343
# write and read connection). Defaults to +false+.
44-
def configs_for(env_name: nil, spec_name: nil, name: nil, include_replicas: false, include_hidden: false)
45-
if spec_name
46-
name = spec_name
47-
ActiveSupport::Deprecation.warn("The kwarg `spec_name` is deprecated in favor of `name`. `spec_name` will be removed in Rails 7.0")
48-
end
49-
44+
def configs_for(env_name: nil, name: nil, include_replicas: false, include_hidden: false)
5045
if include_replicas
5146
include_hidden = include_replicas
5247
ActiveSupport::Deprecation.warn("The kwarg `include_replicas` is deprecated in favor of `include_hidden`. When `include_hidden` is passed, configurations with `replica: true` or `database_tasks: false` will be returned. `include_replicas` will be removed in Rails 7.1.")

activerecord/test/cases/database_configurations_test.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ def test_unsupported_method_raises
127127
end
128128
end
129129

130-
def test_spec_name_in_configs_for_is_deprecated
131-
assert_deprecated do
132-
db_config = ActiveRecord::Base.configurations.configs_for(env_name: "arunit", spec_name: "primary")
133-
134-
assert_equal "primary", db_config.name
135-
end
136-
end
137-
138130
def test_spec_name_getter_is_deprecated
139131
db_config = ActiveRecord::Base.configurations.configs_for(env_name: "arunit", name: "primary")
140132

guides/source/7_0_release_notes.md

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

103103
* Remove deprecated `ActiveRecord::Base.allow_unsafe_raw_sql`.
104104

105+
* Remove deprecated option `:spec_name` in the `configs_for` method.
106+
105107
### Deprecations
106108

107109
### Notable changes

0 commit comments

Comments
 (0)