Skip to content

Commit 03683fe

Browse files
committed
namespace registry
1 parent cf313a9 commit 03683fe

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/view_component/cache_registry.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
module CachingRegistry # :nodoc:
1+
2+
module ViewComponent
3+
module CachingRegistry # :nodoc:
24
extend self
35

46
def caching?
5-
ActiveSupport::IsolatedExecutionState[:action_view_caching] ||= false
7+
ActiveSupport::IsolatedExecutionState[:view_component_caching] ||= false
68
end
79

810
def track_caching
9-
caching_was = ActiveSupport::IsolatedExecutionState[:action_view_caching]
11+
caching_was = ActiveSupport::IsolatedExecutionState[:view_component_caching]
1012
ActiveSupport::IsolatedExecutionState[:action_view_caching] = true
1113

1214
yield
1315
ensure
14-
ActiveSupport::IsolatedExecutionState[:action_view_caching] = caching_was
16+
ActiveSupport::IsolatedExecutionState[:view_component_caching] = caching_was
1517
end
18+
end
1619
end

lib/view_component/cacheable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def view_cache_dependencies
2424
# @private
2525
def __vc_render_cacheable(rendered_template)
2626
if __vc_cache_dependencies != [:format, :__vc_format]
27-
CachingRegistry.track_caching do
27+
ViewComponent::CachingRegistry.track_caching do
2828
template_fragment(rendered_template)
2929
end
3030
else

0 commit comments

Comments
 (0)