From c03a50ade38865d77d87f60f4a4d7824277ad071 Mon Sep 17 00:00:00 2001 From: Chris LaRose Date: Wed, 6 Mar 2019 17:25:28 -0800 Subject: Explicitly require rails-html-sanitizer gem in ActionText helpers If the [`action_text.helper` initializer][0] runs after `ActionController::Base` has been loaded, but before the `rails-html-sanitizer` gem has been `require`d, then the reference to the constant `Rails::Html` in the body of the `ActionText::ContentHelper` module raises an `uninitialized constant` exception. [0]: https://github.com/rails/rails/blob/21703382393c87212c27c988420ee5c133c1aa9f/actiontext/lib/action_text/engine.rb#L31-L35 --- actiontext/app/helpers/action_text/content_helper.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actiontext/app') diff --git a/actiontext/app/helpers/action_text/content_helper.rb b/actiontext/app/helpers/action_text/content_helper.rb index b3335601f9..2005033d5c 100644 --- a/actiontext/app/helpers/action_text/content_helper.rb +++ b/actiontext/app/helpers/action_text/content_helper.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "rails-html-sanitizer" + module ActionText module ContentHelper SANITIZER = Rails::Html::Sanitizer.white_list_sanitizer -- cgit v1.2.3