Permalink
Browse files

Fixed that purge_test_database would use database settings from the d…

…evelopment environment when recreating the test database #1122 [rails@cogentdude.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 78d8503 commit 154668898aadef2d98093cd3c2b7c895fff8b7a6 @dhh dhh committed Apr 17, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 railties/CHANGELOG
  2. +1 −1 railties/fresh_rakefile
View
@@ -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
View
@@ -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"]

0 comments on commit 1546688

Please sign in to comment.