mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixed that purge_test_database would use database settings from the development 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
This commit is contained in:
parent
78d8503a94
commit
154668898a
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue