diff --git a/lib/rbexy/rails/component_template_resolver.rb b/lib/rbexy/rails/component_template_resolver.rb index 1be9750..51d9f06 100644 --- a/lib/rbexy/rails/component_template_resolver.rb +++ b/lib/rbexy/rails/component_template_resolver.rb @@ -18,12 +18,12 @@ def _find_all(name, prefix, partial, details, key, locals) cache.compute_if_absent(ActionView::TemplatePath.virtual(name, prefix, partial)) do find_templates(name, prefix, partial, details, locals) - end + end.map { |t| t.bind_locals(locals) } end else # Rails 6 implements caching at the call-site (find_all) def _find_all(name, prefix, partial, details, key, locals) - find_templates(name, prefix, partial, details, locals) + find_templates(name, prefix, partial, details, locals).map { |t| t.bind_locals(locals) } end end @@ -81,7 +81,7 @@ def build_template(source:, template_path:, extension:, virtual_path:) template_path, details: ActionView::TemplateDetails.new(nil, extension, extension, nil), virtual_path: virtual_path - ).bind_locals([]) + ) end else def build_template(source:, template_path:, extension:, virtual_path:) @@ -91,7 +91,7 @@ def build_template(source:, template_path:, extension:, virtual_path:) ActionView::Template.handler_for_extension(extension), format: extension.to_sym, virtual_path: virtual_path - ).bind_locals([]) + ) end end