Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Reconnect to the first database after db:create #4140

Merged
merged 1 commit into from

2 participants

@kuroda

Otherwise, the schema and seed will be loaded onto the
test database.

@kuroda kuroda Reconnect to the first database after db:create
Otherwise, the schema and seed will be loaded onto the
test database.
014cdb7
@tenderlove tenderlove merged commit ac2f68d into rails:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 23, 2011
  1. @kuroda

    Reconnect to the first database after db:create

    kuroda authored
    Otherwise, the schema and seed will be loaded onto the
    test database.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  activerecord/lib/active_record/railties/databases.rake
View
1  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)
Something went wrong with that request. Please try again.