aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/CHANGELOG2
-rwxr-xr-xrailties/fresh_rakefile2
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 0ff8f05b95..ce8e68e57c 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed that purge_test_database would use database settings from the development environment when recreating the test database #1122 [rails@cogentdude.com]
+
* Added script/benchmarker to easily benchmark one or more statement a number of times from within the environment. Examples:
# runs the one statement 10 times
diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile
index b563af722b..8c765e57e0 100755
--- a/railties/fresh_rakefile
+++ b/railties/fresh_rakefile
@@ -164,7 +164,7 @@ task :purge_test_database => :environment do
abcs = ActiveRecord::Base.configurations
case abcs["test"]["adapter"]
when "mysql"
- ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
+ ActiveRecord::Base.establish_connection(:test)
ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"])
when "postgresql"
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]