rails/rails — pull request #6518 by kennyj (2012-05-28 16:30:28+00:00)
Title: (Try again) Fix #5847 and #4045.

Previous my fix was reverted (See https://github.com/rails/rails/commit/0a8aec2c97ab93721d5671555f22975da0a20422 ).
And on master, the AR::Base is already loaded durring initialization.

To resolve original issues and AR::Base loading problem, I added 3 commits.

First: I added a testcase for original issue.
Second: I changed the timing of AR::Base loading (some tests weren't success).
Third: I fixed original issues.

/cc @josevalim