From f77fa3ca4acebcbfdfef5c4ba925b55dc7184c06 Mon Sep 17 00:00:00 2001 From: rubic0n Date: Fri, 29 Jan 2021 23:12:53 -0600 Subject: [PATCH] Fix autoloading in initialization DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper. https://github.com/rails/rails/issues/36546 Rails has a Railtie that will take the config setting out of Rails config, and put it onto ActionController when ActionController is loaded. Calling ActionController in the initializer forces it to autoload right now. Referencing the setting through the config allows it to autoload in when it needs to. --- config/initializers/suppress_csrf_warnings.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/suppress_csrf_warnings.rb b/config/initializers/suppress_csrf_warnings.rb index 410ab585..41350c25 100644 --- a/config/initializers/suppress_csrf_warnings.rb +++ b/config/initializers/suppress_csrf_warnings.rb @@ -1,3 +1,3 @@ # frozen_string_literal: true -ActionController::Base.log_warning_on_csrf_failure = false +Rails.application.config.action_controller.log_warning_on_csrf_failure = false