instance method cache_dump_filename

Ruby on Rails 7.2.3

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

cache_dump_filename(db_config_or_name, schema_cache_path: nil)

No documentation comment.

Parameters

db_config_or_name req
schema_cache_path key = nil
Source
# 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

Defined in activerecord/lib/active_record/tasks/database_tasks.rb line 460 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::Tasks::DatabaseTasks

Type at least 2 characters to search.

↑↓ navigate · open · esc close