Module: ActionView::LookupContext::DetailsCache
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | actionview/lib/action_view/lookup_context.rb |
Overview
Add caching behavior on top of Details.
Instance Attribute Summary
- #cache rw
Instance Method Summary
-
#disable_cache
Temporary skip passing the details_key forward.
- #_set_detail(key, value) private
Instance Attribute Details
#cache (rw)
[ GitHub ]# File 'actionview/lib/action_view/lookup_context.rb', line 80
attr_accessor :cache
Instance Method Details
#_set_detail(key, value) (private)
[ GitHub ]# File 'actionview/lib/action_view/lookup_context.rb', line 98
def _set_detail(key, value) # :doc: @details = @details.dup if @details_key @details_key = nil @details[key] = value end
#disable_cache
Temporary skip passing the details_key forward.
# File 'actionview/lib/action_view/lookup_context.rb', line 89
def disable_cache old_value, @cache = @cache, false yield ensure @cache = old_value end