method
cache_dump_filename
v7.2.3 -
Show latest stable
- Class:
ActiveRecord::Tasks::DatabaseTasks
cache_dump_filename(db_config_or_name, schema_cache_path: nil)public
No documentation available.
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 460
def cache_dump_filename(db_config_or_name, schema_cache_path: nil)
if db_config_or_name.is_a?(DatabaseConfigurations::DatabaseConfig)
schema_cache_path ||
db_config_or_name.schema_cache_path ||
schema_cache_env ||
db_config_or_name.default_schema_cache_path(ActiveRecord::Tasks::DatabaseTasks.db_dir)
else
ActiveRecord.deprecator.warn(<<~MSG.squish)
Passing a database name to `cache_dump_filename` is deprecated and will be removed in Rails 8.0. Pass a
`ActiveRecord::DatabaseConfigurations::DatabaseConfig` object instead.
MSG
filename = if ActiveRecord::Base.configurations.primary?(db_config_or_name)
"schema_cache.yml"
else
"#{db_config_or_name}_schema_cache.yml"
end
schema_cache_path || schema_cache_env || File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, filename)
end
end