bmabey/database_cleaner — pull request #241 by tommeier (2013-08-22 11:25:40+00:00)
Title: Fix MySqlAdapter superclass bug via class_eval loading of superclasses

As discussed in : https://github.com/bmabey/database_cleaner/pull/221 but this is based off latest `database_cleaner` master (1.1.1).

(copied content from old closed pull request):
Hi,
I've had an attempt at the first cut for running with proper decoration of adapters for truncation.

Though the more I got into it the more design decisions I noticed, and didn't quite understand.

Could you have a look at this? and let me know if you think its on the right track or if i've missed a critical design choice in the cull. The main change is applying on the underlying adapter rather than the superclass (if class_evaling on the superclass, you'd then need to forcibly reload the subclass, or so I can gather). In theory, this should work for the Arjdbc adapters too, but I don't have a running JRuby app to do extensive testing with. Best to get this working with the minimum as so, and work out the other edge cases again, unless you see them straight away.

Though, my moped tests still fail (connection error), but it appears others have that https://github.com/bmabey/database_cleaner/issues/215 and it probably just needs a 'testing' blurb added to the `README`. Are the features meant to pass? Or is `rake spec` the only focus right now?

### TODO
* [ ] Test on JRuby with ArJdbc adapters
* [x] Test with issues on postgres/mysql combination exposed by @simi and @etagwerker
* [x] Tested on postgres
* [x] Tested on mysql
* [x] Tested on mongo
* [ ] Tested on couchpotato
* [x] Tested on Sqllite3 (thanks @fredwu )
* [x] Tested on redis
* [x] Fix issues with datamapper
* [x] ~~Update `README` with 'how to run test setup' (specifically couchpotato and moped connection issues)~~