aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/railties/databases.rake4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index 4343bef3d4..ed7d2a045e 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -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])