Spec-Zone.ru › Ruby on Rails 7.0

класс ActiveRecord::NoDatabaseError

Родитель:
ActiveRecord::StatementInvalid
Включенные модули:
ActiveSupport::ActionableError

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

Публичные методы класса

db_error(db_name) Показать исходный код
# File activerecord/lib/active_record/errors.rb, line 250
      def db_error(db_name)
        NoDatabaseError.new(<<~MSG)
          We could not find your database: #{db_name}. Which can be found in the database configuration file located at config/database.yml.

          To resolve this issue:

          - Did you create the database for this app, or delete it? You may need to create your database.
          - Has the database name changed? Check your database.yml config has the correct database name.

          To create your database, run:\n\n        bin/rails db:create
        MSG
      end
new(message = nil) Показать исходный код
# File activerecord/lib/active_record/errors.rb, line 245
def initialize(message = nil)
  super(message || "Database not found")
end
Вызывает метод родительского класса ActiveRecord::StatementInvalid::new

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

Spec-Zone.ru

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