aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-11-21 14:11:19 -0800
committerXavier Noria <fxn@hashref.com>2011-11-21 14:11:40 -0800
commita539a5e3f3be68f027d3dfe43f88dc9f0642c743 (patch)
treec6204955fb3eb948816740ad1f0a39abb9298074 /activesupport/lib/active_support
parentf3554777b2433d9de6b17c277fde071592d6a10d (diff)
downloadrails-a539a5e3f3be68f027d3dfe43f88dc9f0642c743.tar.gz
rails-a539a5e3f3be68f027d3dfe43f88dc9f0642c743.tar.bz2
rails-a539a5e3f3be68f027d3dfe43f88dc9f0642c743.zip
tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/cache.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index 2bf24558a6..2acc54bbfc 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,11 +382,7 @@ module ActiveSupport
options = merged_options(options)
instrument(:exist?, name) do |payload|
entry = read_entry(namespaced_key(name, options), options)
- if entry && !entry.expired?
- true
- else
- false
- end
+ entry && !entry.expired?
end
end