mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Adding guard to make sure test database declarations exist before trying to auto create
This commit is contained in:
@@ -28,8 +28,8 @@ namespace :db do
|
||||
|
||||
desc 'Create the database defined in config/database.yml for the current Rails.env - also makes test database if in development mode'
|
||||
task :create => :load_config do
|
||||
# Make the test database at the same time as the development one
|
||||
if Rails.env == 'development'
|
||||
# Make the test database at the same time as the development one, if it exists
|
||||
if Rails.env.development? && ActiveRecord::Base.configurations['test']
|
||||
create_database(ActiveRecord::Base.configurations['test'])
|
||||
end
|
||||
create_database(ActiveRecord::Base.configurations[Rails.env])
|
||||
|
||||
Reference in New Issue
Block a user