method

db_configs_with_versions

Importance_0
v7.0.0 - 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 271
      def db_configs_with_versions(db_configs) # :nodoc:
        db_configs_with_versions = Hash.new { |h, k| h[k] = [] }

        db_configs.each do |db_config|
          ActiveRecord::Base.establish_connection(db_config)
          versions_to_run = ActiveRecord::Base.connection.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.