diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-02-04 10:59:24 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-02-04 11:57:13 +1100 |
commit | 02ef8d20a19f9548800eaefc0ebdf18fbd9a67be (patch) | |
tree | 148c14cf55a88c0fedf1e1b7d2f9ebfe8b701452 /activerecord/lib | |
parent | f497e7ad1d52fb795784cf6f5b2bc456e46dbd27 (diff) | |
download | rails-02ef8d20a19f9548800eaefc0ebdf18fbd9a67be.tar.gz rails-02ef8d20a19f9548800eaefc0ebdf18fbd9a67be.tar.bz2 rails-02ef8d20a19f9548800eaefc0ebdf18fbd9a67be.zip |
Adding guard to make sure test database declarations exist before trying to auto create
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
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]) |