Exception: ActiveRecord::NoDatabaseError
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
|
|
|
Instance Chain:
self,
::ActiveSupport::ActionableError,
StatementInvalid,
AdapterError,
ActiveRecordError,
StandardError
|
|
| Inherits: |
ActiveRecord::StatementInvalid
|
| Defined in: | activerecord/lib/active_record/errors.rb |
Overview
Raised when a given database does not exist.
::ActiveSupport::ActionableError - Attributes & Methods
- ._actions rw
- #_actions rw
- ._actions? ⇒ Boolean rw
- #_actions? ⇒ Boolean rw
Class Method Summary
StatementInvalid - Inherited
AdapterError - Inherited
Instance Attribute Summary
Instance Method Summary
StatementInvalid - Inherited
Constructor Details
.new(message = nil, connection_pool: nil) ⇒ NoDatabaseError
# File 'activerecord/lib/active_record/errors.rb', line 335
def initialize( = nil, connection_pool: nil) super( || "Database not found", connection_pool: connection_pool) end
Class Attribute Details
._actions (rw)
[ GitHub ]# File 'activesupport/lib/active_support/actionable_error.rb', line 17
class_attribute :_actions, default: {}
._actions? ⇒ Boolean (rw)
[ GitHub ]
# File 'activesupport/lib/active_support/actionable_error.rb', line 17
class_attribute :_actions, default: {}
Class Method Details
.db_error(db_name)
[ GitHub ]# File 'activerecord/lib/active_record/errors.rb', line 340
def db_error(db_name) NoDatabaseError.new(<<~MSG) We could not find your database: #{db_name}. Available database configurations can be found in config/database.yml. To resolve this error: - Did you not create the database, or did you delete it? To create the database, run: bin/rails db:create - Has the database name changed? Verify that config/database.yml contains the correct database name. MSG end
Instance Attribute Details
#_actions (rw)
[ GitHub ]# File 'activesupport/lib/active_support/actionable_error.rb', line 17
class_attribute :_actions, default: {}
#_actions? ⇒ Boolean (rw)
[ GitHub ]
# File 'activesupport/lib/active_support/actionable_error.rb', line 17
class_attribute :_actions, default: {}