Skip to content

Commit

Permalink
Copy the config to each new component as it is created
Browse files Browse the repository at this point in the history
Fixes #2867
  • Loading branch information
jcoyne authored and cbeer committed Nov 8, 2022
1 parent fba20c8 commit 6600e0a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion blacklight.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |s|
s.add_dependency "deprecation"
s.add_dependency "i18n", '>= 1.7.0' # added named parameters
s.add_dependency "ostruct", '>= 0.3.2'
s.add_dependency "view_component", '~> 2.43'
s.add_dependency "view_component", '~> 2.66'
s.add_dependency 'hashdiff'

s.add_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
Expand Down
5 changes: 5 additions & 0 deletions lib/blacklight/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
module Blacklight
class Component < ViewComponent::Base
class << self
# Workaround for https://github.com/ViewComponent/view_component/issues/1565
def config
@config ||= ViewComponent::Config.defaults.merge(ViewComponent::Base.config)
end

# rubocop:disable Naming/MemoizedInstanceVariableName
def compiler
@__vc_compiler ||= EngineCompiler.new(self)
Expand Down

0 comments on commit 6600e0a

Please sign in to comment.