Skip to content

Commit 0a0d319

Browse files
ReeganReegan
authored andcommitted
fix ci
1 parent 430616c commit 0a0d319

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/view_component/base.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ def virtual_path
326326
self.class.virtual_path
327327
end
328328

329+
# For caching, such as #cache_if
330+
# @private
331+
def view_cache_dependencies
332+
[]
333+
end
334+
329335
if defined?(Rails::VERSION) && Rails::VERSION::MAJOR == 7 && Rails::VERSION::MINOR == 1
330336
# Rails expects us to define `format` on all renderables,
331337
# but we do not know the `format` of a ViewComponent until runtime.

lib/view_component/compiler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def define_render_template_for
9090
safe_call = template.safe_method_name_call
9191
@component.define_method(:render_template_for) do |_|
9292
@current_template = template
93-
if respond_to?(:__vc_render_cacheable)
93+
if is_a?(ViewComponent::Cacheable)
9494
__vc_render_cacheable(safe_call)
9595
else
9696
instance_exec(&safe_call)
@@ -100,7 +100,7 @@ def define_render_template_for
100100
compiler = self
101101
@component.define_method(:render_template_for) do |details|
102102
if (@current_template = compiler.find_templates_for(details).first)
103-
if respond_to?(:__vc_render_cacheable)
103+
if is_a?(ViewComponent::Cacheable)
104104
__vc_render_cacheable(@current_template.safe_method_name_call)
105105
else
106106
instance_exec(&@current_template.safe_method_name_call)

0 commit comments

Comments
 (0)