rails/rails — pull request #8246 by urielka (2012-11-17 00:56:29+00:00)
Title: Fix #8167 - adding autoloading support for caching

I wrote a (quite) simple fix for supporting autoloading in ActiveSupport::Cache (which relays on Marshal#load/dump).

Changes:
* Added a new object called ActiveSupport::ObjectSerializer which provides dump/load like Marshal,dump is basically delegated to Marshal but load is wrapped in a begin/rescue that tries to load missing classes.
* Used this new object in MemCacheStore and FileStore (NullStore and MemStore don't marshal objects)
* Extracted few useful methods in dependecies_test.rb into dependecies_test_helpers.rb and used them in object_serializer/dependecies_test/caching_test.rb
* Modified caching_test.rb with two cases that trigger the autoloading.

Testing done:
Run the tests in ActiveSupport including my new tests

Environment:
ruby 1.9.3p0 using rails-dev-box (great project!)