orslumen/record-cache — pull request #31 by joshtabak (2013-03-13 03:16:15+00:00)
Title: Disables writes to the cache during a transaction

In application code, ActiveRecord can create a record during a transaction.

If we allow record-cache to write this record into the cache, and the transaction is rolledback, future select queries can return a record from cache that doesn't exist in the database. This gave us some problems, especially when running our own test suite.

This pull request prevents the above from happening, but is completely untested on system setups other than what we use for twitch.tv, and has the potential to be dangerous.

cache_writeable? is stubbed to return true for the record-cache test suite because rspec runs tests in transactions by default, and the tests are written with the assumption that things will go into cache during the tests.