Skip to content

Commit

Permalink
Merge pull request #2868 from projectblacklight/view-componet-config
Browse files Browse the repository at this point in the history
Copy the config to each new component as it is created
  • Loading branch information
jcoyne committed Nov 4, 2022
2 parents 0bdfc3a + b364fb6 commit 4010fa1
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 @@ -31,7 +31,7 @@ Gem::Specification.new do |s|
s.add_dependency "kaminari", ">= 0.15" # the pagination (page 1,2,3, etc..) of our search results
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_development_dependency "rsolr", ">= 1.0.6", "< 3" # Library for interacting with rSolr.
s.add_development_dependency "rspec-rails", "~> 6.0"
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 4010fa1

Please sign in to comment.