instance method
with_local_cache
Ruby on Rails 3.2.22.5
Since v2.3.18Signature
with_local_cache()
Use a local cache for the duration of block.
Source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 43
def with_local_cache
save_val = Thread.current[thread_local_key]
begin
Thread.current[thread_local_key] = LocalStore.new
yield
ensure
Thread.current[thread_local_key] = save_val
end
end
Defined in activesupport/lib/active_support/cache/strategy/local_cache.rb line 43
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::Strategy::LocalCache