diff options
author | Xavier Noria <fxn@hashref.com> | 2011-11-21 14:14:11 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-11-21 14:14:11 -0800 |
commit | f312e2142b59b39637ab3d668876c3babac22087 (patch) | |
tree | 5c2055387b3e6d2c39cd35bdae1d1506cd2bd9c2 /activesupport/lib | |
parent | a539a5e3f3be68f027d3dfe43f88dc9f0642c743 (diff) | |
download | rails-f312e2142b59b39637ab3d668876c3babac22087.tar.gz rails-f312e2142b59b39637ab3d668876c3babac22087.tar.bz2 rails-f312e2142b59b39637ab3d668876c3babac22087.zip |
Revert "tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false"
Reason: there were some genuine tests for false when
reading values, going to revise those ones.
This reverts commit a539a5e3f3be68f027d3dfe43f88dc9f0642c743.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index 2acc54bbfc..2bf24558a6 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -365,7 +365,7 @@ module ActiveSupport end end - # Deletes an entry in the cache. Returns true if an entry is deleted. + # Deletes an entry in the cache. Returns +true+ if an entry is deleted. # # Options are passed to the underlying cache implementation. def delete(name, options = nil) @@ -382,7 +382,11 @@ module ActiveSupport options = merged_options(options) instrument(:exist?, name) do |payload| entry = read_entry(namespaced_key(name, options), options) - entry && !entry.expired? + if entry && !entry.expired? + true + else + false + end end end |