lib/cachetastic/cache.rb in cachetastic-3.0.1 vs lib/cachetastic/cache.rb in cachetastic-3.0.2
- old
+ new
@@ -134,11 +134,11 @@
elsif val.respond_to?(:blank?)
val = nil if val.blank?
end
return val unless val.nil?
- val = yield if block_given?
+ val = yield key if block_given?
return val
end
def do_with_logging(action, key)
if adapter.debug?
@@ -153,10 +153,10 @@
str << "\t" << res.inspect
end
logger.debug(:finished, action, cache_klass.name, key, (end_time - start_time), str)
return res
else
- return yield if block_given?
+ return yield(key) if block_given?
end
end
end # class << self
\ No newline at end of file