rails/rails — pull request #9118 by dazuma (2013-01-30 03:32:50+00:00)
Title: Fix to databases.rake so third party adapters can register rake task implementations

ActiveRecord::Tasks::DatabaseTasks provides support for external connection adapters to provide their own rake task implementations. This was great news for those of us maintaining external connection adapters.

Unfortunately, three of the rake tasks in databases.rake still include a hard-coded gate on the adapter name. Only certain adapters (MySQL, Postgres, and Sqlite) get passed to DatabaseTasks, with the result that third party connection adapters are still locked out of providing implementations for those three tasks.

This is a small diff that removes the hard-coded adapter name check, and instead makes DatabaseTasks the default (fallback) implementation for those tasks. Therefore, now, when one of these three rake tasks are run:

* For the main adapters (MySQL, Postgres, and Sqlite), this has no effect.
* For third party adapters, this gives them a chance to run their code via DatabaseTasks
* For "unknown" adapters where a rake task implementation is not provided, the behavior changes from an exception thrown out of databases.rake, to an exception thrown out of DatabaseTasks. Thus, it now matches the behavior of most of the rest of the other rake tasks.