Created
September 16, 2009 00:18
-
-
Save actsasflinn/187770 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix memory caching in dev mode | |
# put this in config/initializers/fix_caching_in_dev.rb | |
# Hopefully this won't be needed for long, this fixes cache calls (due to class reloading in dev) | |
# http://blog.bashme.org/2008/07/25/rails-21-model-caching-issue/ | |
if ActiveSupport::Dependencies.mechanism == :load | |
module ActiveSupport | |
module Cache | |
class Store | |
def fetch(key, options = {}) | |
log("write (will save)", key, nil) | |
(block_given?) ? yield : nil | |
end | |
def read(key, options = {}) | |
log("read", key, options) | |
# Always return nil in dev! | |
write(key, nil) | |
return nil | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment