Spec-Zone.ru › Ruby on Rails 8.1

class ActiveRecord::NoDatabaseError

Родительский класс:
ActiveRecord::StatementInvalid
Подключаемые модули:
ActiveSupport::ActionableError

Вызывается, если указанная база данных не существует.

Общедоступные методы класса

db_error (db_name) Показать исходный код
# File activerecord/lib/active_record/errors.rb, line 347
      def db_error(db_name)
        NoDatabaseError.new(<<~MSG)
          Database not found: #{db_name}. Available database configurations can be found in config/database.yml.

          To resolve this error:

          - Create the database by running:

              bin/rails db:create

          - Verify that config/database.yml contains the correct database name.
        MSG
      end
new (message = nil, connection_pool: nil) Показать исходный код
# File activerecord/lib/active_record/errors.rb, line 342
def initialize(message = nil, connection_pool: nil)
  super(message || "Database not found", connection_pool: connection_pool)
end
Вызывает метод суперкласса ActiveRecord::StatementInvalid::new

© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API