diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-03 10:32:27 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-03 10:32:27 +0100 |
commit | b13504303b26a07f95f26ab6efe41f3bc0740a69 (patch) | |
tree | e3b92e910ce71e87487eb31bb091700ddff3ae09 /activerecord/lib/active_record/railties | |
parent | 80e49354f17853130dd2ae5815d71d192c8ec9d7 (diff) | |
parent | f390eade5fd70615ba2ee8e089821bcf2d5f7b17 (diff) | |
download | rails-b13504303b26a07f95f26ab6efe41f3bc0740a69.tar.gz rails-b13504303b26a07f95f26ab6efe41f3bc0740a69.tar.bz2 rails-b13504303b26a07f95f26ab6efe41f3bc0740a69.zip |
Merge remote branch 'mikel/master'
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index 2ef8676f39..4343bef3d4 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 @@ -196,6 +200,9 @@ namespace :db do when 'postgresql' ActiveRecord::Base.establish_connection(config) puts ActiveRecord::Base.connection.encoding + when 'sqlite3' + ActiveRecord::Base.establish_connection(config) + puts ActiveRecord::Base.connection.encoding else puts 'sorry, your database adapter is not supported yet, feel free to submit a patch' end |