From 014cdb7f7bf8e6a950a555ddbb273ecc514f8f15 Mon Sep 17 00:00:00 2001 From: Tsutomu Kuroda Date: Fri, 23 Dec 2011 14:43:47 +0900 Subject: Reconnect to the first database after db:create Otherwise, the schema and seed will be loaded onto the test database. --- activerecord/lib/active_record/railties/databases.rake | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib') 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) -- cgit v1.2.3