mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove unreachable database warning
`establish_connection` will never raise `ActiveRecord::NoDatabaseError`, because it doesn't connect to a database; it sets up a connection pool.
This commit is contained in:
parent
c55fc43b3f
commit
2583986071
1 changed files with 1 additions and 15 deletions
|
@ -168,21 +168,7 @@ end_error
|
|||
initializer "active_record.initialize_database" do
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
self.configurations = Rails.application.config.database_configuration
|
||||
|
||||
begin
|
||||
establish_connection
|
||||
rescue ActiveRecord::NoDatabaseError
|
||||
warn <<-end_warning
|
||||
Oops - You have a database configured, but it doesn't exist yet!
|
||||
|
||||
Here's how to get started:
|
||||
|
||||
1. Configure your database in config/database.yml.
|
||||
2. Run `rails db:create` to create the database.
|
||||
3. Run `rails db:setup` to load your database schema.
|
||||
end_warning
|
||||
raise
|
||||
end
|
||||
establish_connection
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue