Skip to content

Commit

Permalink
Don't bind locals on the cached unbound templates
Browse files Browse the repository at this point in the history
  • Loading branch information
patbenatar committed Oct 18, 2023
1 parent b14c0d1 commit 179745f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rbexy/rails/component_template_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:)
Expand All @@ -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

Expand Down

0 comments on commit 179745f

Please sign in to comment.