From 02d2958b6cd84d687d89112eb7e2306a6a89c082 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Sat, 5 Jan 2019 16:59:54 -0500 Subject: Reset ActionText::Content.renderer before and after each request --- actiontext/lib/action_text/engine.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'actiontext/lib') diff --git a/actiontext/lib/action_text/engine.rb b/actiontext/lib/action_text/engine.rb index 01222f077b..51ff5b575b 100644 --- a/actiontext/lib/action_text/engine.rb +++ b/actiontext/lib/action_text/engine.rb @@ -34,13 +34,16 @@ module ActionText end end - initializer "action_text.renderer" do + initializer "action_text.renderer" do |app| + app.executor.to_run { ActionText::Content.renderer = ApplicationController.renderer } + app.executor.to_complete { ActionText::Content.renderer = ApplicationController.renderer } + ActiveSupport.on_load(:action_text_content) do - self.renderer ||= ApplicationController.renderer + self.renderer = ApplicationController.renderer end ActiveSupport.on_load(:action_controller_base) do - before_action { ActionText::Content.renderer = ActionText::Content.renderer.new(request.env) } + before_action { ActionText::Content.renderer = ApplicationController.renderer.new(request.env) } end end end -- cgit v1.2.3