diff options
author | George Claghorn <george@basecamp.com> | 2019-01-05 16:59:54 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2019-01-05 16:59:54 -0500 |
commit | 02d2958b6cd84d687d89112eb7e2306a6a89c082 (patch) | |
tree | 4d6211a5876e1c254d466f49fc40226782dfd8fc | |
parent | f99b3c5f9759baffec5c1f7abf74e108e2fb1c77 (diff) | |
download | rails-02d2958b6cd84d687d89112eb7e2306a6a89c082.tar.gz rails-02d2958b6cd84d687d89112eb7e2306a6a89c082.tar.bz2 rails-02d2958b6cd84d687d89112eb7e2306a6a89c082.zip |
Reset ActionText::Content.renderer before and after each request
-rw-r--r-- | actiontext/lib/action_text/engine.rb | 9 |
1 files changed, 6 insertions, 3 deletions
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 |