From a539a5e3f3be68f027d3dfe43f88dc9f0642c743 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 21 Nov 2011 14:11:19 -0800 Subject: tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false --- activesupport/lib/active_support/cache.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3