bmabey/database_cleaner — pull request #91 by ddemaree (2012-01-09 01:51:23+00:00)
Title: Fixed superclass mismatch error on ActiveRecord 3.2 RC

DatabaseCleaner's Truncation strategy is implemented by patching some code in various ActiveRecord connection adapters. While the connection adapter architecture has been more or less stable since Rails 2.3, the upcoming 3.2 release attempts to share some behavior between the Mysql and Mysql2 adapters by adding a new abstract superclass, AbstractMysqlAdapter. Long story short, using DatabaseCleaner on Rails 3.2 causes applications to crash while booting. This works around the issue by checking for the existence of AbstractMysqlAdapter and using it for MySQL engines if present, falling back to AbstractAdapter if it's not present.