aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorTsutomu Kuroda <t-kuroda@oiax.jp>2011-12-23 14:43:47 +0900
committerTsutomu Kuroda <t-kuroda@oiax.jp>2011-12-23 14:43:47 +0900
commit014cdb7f7bf8e6a950a555ddbb273ecc514f8f15 (patch)
treeff82951875afd0d354c4ad77620f4c428798e6bf /activerecord
parentead2593a54223498647555171e930f9cbe08759c (diff)
downloadrails-014cdb7f7bf8e6a950a555ddbb273ecc514f8f15.tar.gz
rails-014cdb7f7bf8e6a950a555ddbb273ecc514f8f15.tar.bz2
rails-014cdb7f7bf8e6a950a555ddbb273ecc514f8f15.zip
Reconnect to the first database after db:create
Otherwise, the schema and seed will be loaded onto the test database.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/railties/databases.rake1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index 199eee4359..de299dbe91 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -38,6 +38,7 @@ db_namespace = namespace :db do
desc 'Create the database from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)'
task :create => :load_config do
configs_for_environment.each { |config| create_database(config) }
+ ActiveRecord::Base.establish_connection(configs_for_environment.first)
end
def mysql_creation_options(config)