File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments