method

raise_for_multi_db

Importance_0
v7.1.3.4 - 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 156
      def raise_for_multi_db(environment = env, command)) # :nodoc:
        db_configs = 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.