File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ module ViewComponent::Cacheable
12
12
def view_cache_dependencies
13
13
return if __vc_cache_dependencies . blank? || __vc_cache_dependencies . none? || __vc_cache_dependencies . nil?
14
14
15
- retrieve_cache_key ( __vc_cache_dependencies )
15
+ computed_view_cache_dependencies = __vc_cache_dependencies . map { |dep | if respond_to? ( dep ) then public_send ( dep ) end }
16
+ retrieve_cache_key ( computed_view_cache_dependencies )
16
17
end
17
18
18
19
# Render component from cache if possible
@@ -35,8 +36,8 @@ def retrieve_cache_key(key)
35
36
when key . respond_to? ( :cache_key_with_version ) then key . cache_key_with_version
36
37
when key . respond_to? ( :cache_key ) then key . cache_key
37
38
when key . is_a? ( Array ) then key . map { |element | retrieve_cache_key ( element ) } . to_param
38
- when key . respond_to? ( :to_a ) then retrieve_cache_key ( key . to_a )
39
- when respond_to? ( key ) then public_send ( key ) . to_param
39
+ when key . respond_to? ( :to_a ) then retrieve_cache_key ( key . to_a )
40
+ else key . to_param
40
41
end . to_s
41
42
end
42
43
end
You can’t perform that action at this time.
0 commit comments