Update for issue #8968.

In reference to [issue #8968](https://github.com/rails/rails/issues/8968), I have made some simple changes which pass using all ActiveRecord tests. The commit message says 'Working on resolving issue 8968' but was, again, tested immediately afterwards and showed no failures.