lib/active_support/cache.rb in activesupport-2.3.4 vs lib/active_support/cache.rb in activesupport-2.3.5
- old
+ new
@@ -99,9 +99,16 @@
end
alias silence? silence
alias logger_off? logger_off
+ def mute
+ previous_silence, @silence = defined?(@silence) && @silence, true
+ yield
+ ensure
+ @silence = previous_silence
+ end
+
# Fetches data from the cache, using the given key. If there is data in
# the cache with the given key, then that data is returned.
#
# If there is no such data in the cache (a cache miss occurred), then
# then nil will be returned. However, if a block has been passed, then