Skip to content

Commit

Permalink
Reconnect to the first database after db:create
Browse files Browse the repository at this point in the history
Otherwise, the schema and seed will be loaded onto the
test database.
  • Loading branch information
kuroda committed Dec 23, 2011
1 parent ead2593 commit 014cdb7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activerecord/lib/active_record/railties/databases.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 014cdb7

Please sign in to comment.