aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-02-03 16:39:04 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2010-02-03 16:39:04 +1100
commitfbdef7aafe753d2375b16c5dcf70a463996b929f (patch)
tree74b0f993e51ca23a9d846cfc4ac0c1bef32483cb /activerecord
parent76d5428c3360ae837107ccedb418fc7b0d2aa578 (diff)
downloadrails-fbdef7aafe753d2375b16c5dcf70a463996b929f.tar.gz
rails-fbdef7aafe753d2375b16c5dcf70a463996b929f.tar.bz2
rails-fbdef7aafe753d2375b16c5dcf70a463996b929f.zip
Made rake db:create also create the test database if you are in development mode
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/railties/databases.rake6
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