Skip to content

Commit 5f04ead

Browse files
authored
Merge pull request rails#54627 from skipkayhil/hm-av-io
Only create one config per AV::Base
2 parents a77a358 + 7066775 commit 5f04ead

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

actionview/lib/action_view/base.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ def self.with_context(context, assigns = {}, controller = nil)
242242
# :startdoc:
243243

244244
def initialize(lookup_context, assigns, controller) # :nodoc:
245-
@_config = ActiveSupport::InheritableOptions.new
246-
247245
@lookup_context = lookup_context
248246

249247
@view_renderer = ActionView::Renderer.new @lookup_context

actionview/lib/action_view/helpers/controller_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ module ControllerHelper # :nodoc:
2020
def assign_controller(controller)
2121
if @_controller = controller
2222
@_request = controller.request if controller.respond_to?(:request)
23-
@_config = controller.config.inheritable_copy if controller.respond_to?(:config)
23+
if controller.respond_to?(:config)
24+
@_config = controller.config.inheritable_copy
25+
else
26+
@_config = ActiveSupport::InheritableOptions.new
27+
end
2428
@_default_form_builder = controller.default_form_builder if controller.respond_to?(:default_form_builder)
2529
else
2630
@_request ||= nil
27-
@_config ||= nil
31+
@_config = ActiveSupport::InheritableOptions.new
2832
@_default_form_builder ||= nil
2933
end
3034
end

0 commit comments

Comments
 (0)