method

db_configs_with_versions

Importance_0
v7.1.3.4 - Show latest stable - 0 notes - Class: DatabaseTasks
db_configs_with_versions(db_configs) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/tasks/database_tasks.rb, line 258
      def db_configs_with_versions(db_configs) # :nodoc:
        db_configs_with_versions = Hash.new { |h, k| h[k] = [] }

        with_temporary_connection_for_each do |conn|
          db_config = conn.pool.db_config
          versions_to_run = conn.migration_context.pending_migration_versions
          target_version = ActiveRecord::Tasks::DatabaseTasks.target_version

          versions_to_run.each do |version|
            next if target_version && target_version != version
            db_configs_with_versions[version] << db_config
          end
        end

        db_configs_with_versions
      end
Register or log in to add new notes.