rails/rails — pull request #4030 by Juanmcuello (2011-12-19 17:02:12+00:00)
Title: Fix database tasks in test namespace.

Commit 15fb4302b6ff16e641b6279a3530eb8ed97f2899 introduced some issues.

Previously to that commit, when I executed `rake db:test:clone_structure`
the structure was dumped (to structure.sql) and then loaded again no matter whether
the `config.active_record.schema_format` was set to :sql or :ruby. That was OK
because I'm explicitly saying that I want the structure to be cloned.

Now, when I call the same task, although the structure is dumped, the loaded schema
depends on the value of the `config.active_record.schema_format`. So If I have it set
to :ruby and then I call `rake db:test:clone_structure` the loaded file is schema.rb and
not the structure.sql how it is supposed to be according to the name of the task and
its description.

The same thing happens when I call `rake db:test:clone`. When called,
a new schema.rb is created but the file used to load the schema depends on
`config.active_record.schema_format`. If I have it set to :sql, a new schema.rb
is created but the structure.sql file is used to create the database. So it is
not consistent.

This pull request solves the problem. When `db:test:clone_structure` is invoked, the
structure is dumped and then loaded into the test database. When `db:test:clone` is
invoked the schema is dumped and then loaded into the test database. None of these
tasks depends now on the value of `config.active_record.schema_format`