Skip to content

Commit

Permalink
Remove component-local config for now
Browse files Browse the repository at this point in the history
No settings actually use it, but this would be the way to introduce it once we come to need it.
  • Loading branch information
boardfish committed Oct 10, 2024
1 parent 4d4c879 commit d60bec5
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/view_component/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -513,16 +513,6 @@ def inherited(child)
# `compile` defines
compile

if child.superclass == ViewComponent::Base
child.define_singleton_method(:component_config) do
@@component_config ||= Rails.application.config.view_component.inheritable_copy
end
else
child.define_singleton_method(:component_config) do
@@component_config ||= superclass.component_config.inheritable_copy
end
end

# Give the child its own personal #render_template_for to protect against the case when
# eager loading is disabled and the parent component is rendered before the child. In
# such a scenario, the parent will override ViewComponent::Base#render_template_for,
Expand Down

0 comments on commit d60bec5

Please sign in to comment.