Skip to content

Commit 5407776

Browse files
Merge pull request rails#50137 from jonathanhefner/active_record-no_database_error-message
Tweak message for `NoDatabaseError`
2 parents f0b587b + acf00cb commit 5407776

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

activerecord/lib/active_record/errors.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,15 @@ def initialize(message = nil, connection_pool: nil)
318318
class << self
319319
def db_error(db_name)
320320
NoDatabaseError.new(<<~MSG)
321-
We could not find your database: #{db_name}. Available database configurations can be found in config/database.yml file.
321+
We could not find your database: #{db_name}. Available database configurations can be found in config/database.yml.
322322
323323
To resolve this error:
324324
325-
- Did you create the database for this app, or delete it? You may need to create your database.
326-
- Has the database name changed? Check your database.yml config has the correct database name.
325+
- Did you not create the database, or did you delete it? To create the database, run:
327326
328-
To create your database, run:\n\n bin/rails db:create
327+
bin/rails db:create
328+
329+
- Has the database name changed? Verify that config/database.yml contains the correct database name.
329330
MSG
330331
end
331332
end

0 commit comments

Comments
 (0)