method

raise_for_multi_db

Importance_0
v6.1.3.1 - Show latest stable - 0 notes - Class: DatabaseTasks
raise_for_multi_db(environment = env, command:) 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 178
      def raise_for_multi_db(environment = env, command))
        db_configs = ActiveRecord::Base.configurations.configs_for(env_name: environment)

        if db_configs.count > 1
          dbs_list = []

          db_configs.each do |db|
            dbs_list << "#{command}:#{db.name}"
          end

          raise "You're using a multiple database application. To use `#{command}` you must run the namespaced task with a VERSION. Available tasks are #{dbs_list.to_sentence}."
        end
      end
Register or log in to add new notes.