method

for_each

Importance_0
v6.1.7.7 - Show latest stable - 0 notes - Class: DatabaseTasks
for_each(databases) 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 165
      def for_each(databases)
        return {} unless defined?(Rails)

        database_configs = ActiveRecord::DatabaseConfigurations.new(databases).configs_for(env_name: Rails.env)

        # if this is a single database application we don't want tasks for each primary database
        return if database_configs.count == 1

        database_configs.each do |db_config|
          yield db_config.name
        end
      end
Register or log in to add new notes.