Skip to content

Commit 83f4441

Browse files
committed
Fix deprecation message
The message was partially duplicated because `deprecation_warning` was being called instead of `warn`
1 parent 7e04346 commit 83f4441

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

activerecord/lib/active_record/tasks/database_tasks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def cache_dump_filename(db_config_or_name, schema_cache_path: nil)
444444
ENV["SCHEMA_CACHE"] ||
445445
db_config_or_name.default_schema_cache_path(ActiveRecord::Tasks::DatabaseTasks.db_dir)
446446
else
447-
ActiveRecord.deprecator.deprecation_warning(<<~MSG.squish)
447+
ActiveRecord.deprecator.warn(<<~MSG.squish)
448448
Passing a database name to `cache_dump_filename` is deprecated and will be removed in Rails 7.3. Pass a
449449
`ActiveRecord::DatabaseConfigurations::DatabaseConfig` object instead.
450450
MSG

activerecord/test/cases/tasks/database_tasks_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def test_deprecated_cache_dump_filename_with_env_override
400400
ENV["SCHEMA_CACHE"] = "tmp/something.yml"
401401

402402
ActiveRecord::Tasks::DatabaseTasks.stub(:db_dir, "db") do
403-
path = assert_deprecated(ActiveRecord.deprecator) do
403+
path = assert_deprecated(/Passing a database name to `cache_dump_filename` is deprecated and will be removed in Rails 7\.3\. Pass a `ActiveRecord::DatabaseConfigurations::DatabaseConfig` object instead\. \(/, ActiveRecord.deprecator) do
404404
ActiveRecord::Tasks::DatabaseTasks.cache_dump_filename("primary")
405405
end
406406
assert_equal "tmp/something.yml", path

0 commit comments

Comments
 (0)