diff options
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 2ef8676f39..8ca7c394fd 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -26,8 +26,12 @@ namespace :db do end end - desc 'Create the database defined in config/database.yml for the current Rails.env' + 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' + create_database(ActiveRecord::Base.configurations['test']) + end create_database(ActiveRecord::Base.configurations[Rails.env]) end |