aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/cache.rb
diff options
context:
space:
mode:
authorThijs de Vries <thijs@thijs-de-vriess-macbook.local>2009-01-31 18:31:59 -0500
committerDavid Heinemeier Hansson <david@loudthinking.com>2009-02-05 20:59:05 +0100
commitbe1dbf321aba03c2e9bec423f753308e9bba3ef5 (patch)
treeee8a3fd26b3802cdf399c1c48e891d459ccc19af /activesupport/lib/active_support/cache.rb
parent250dfb18afb58dda3caf4b9f170ddb9c5cf85faf (diff)
downloadrails-be1dbf321aba03c2e9bec423f753308e9bba3ef5.tar.gz
rails-be1dbf321aba03c2e9bec423f753308e9bba3ef5.tar.bz2
rails-be1dbf321aba03c2e9bec423f753308e9bba3ef5.zip
created unit tests and fixed bug that failed tests
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'activesupport/lib/active_support/cache.rb')
-rw-r--r--activesupport/lib/active_support/cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index 83174d3a85..0f848c5933 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -138,7 +138,7 @@ module ActiveSupport
# cache.fetch("foo") # => nil
def fetch(key, options = {})
@logger_off = true
- if !options[:force] && value = read(key, options)
+ if !options[:force] && ((value = read(key, options)) || exist?(key, options))
@logger_off = false
log("hit", key, options)
value