Skip to content

Commit

Permalink
Support view_component 2.74; fixes #2816
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Sep 28, 2022
1 parent 060b944 commit 3e6e51f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/blacklight/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def compiler
@__vc_compiler ||= EngineCompiler.new(self)
end
# rubocop:enable Naming/MemoizedInstanceVariableName

alias sidecar_files _sidecar_files unless ViewComponent::Base.respond_to? :sidecar_files
end

class EngineCompiler < ::ViewComponent::Compiler
Expand All @@ -23,7 +25,7 @@ def templates
@templates ||= begin
extensions = ActionView::Template.template_handler_extensions

component_class._sidecar_files(extensions).each_with_object([]) do |path, memo|
component_class.sidecar_files(extensions).each_with_object([]) do |path, memo|
pieces = File.basename(path).split(".")
app_path = "#{Rails.root}/#{path.slice(path.index(component_class.view_component_path)..-1)}"

Expand Down

0 comments on commit 3e6e51f

Please sign in to comment.