Skip to content

Commit acf00cb

Browse files
Tweak message for NoDatabaseError
This tweaks various phrasing and puts the "To create the database" instructions next to the relevant bullet point instead of at the end of the message.
1 parent 62b1cec commit acf00cb

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)