From 96a8a397f1cc12b223c1c08c340d2edde754c649 Mon Sep 17 00:00:00 2001 From: Nikita Vasilevsky Date: Mon, 7 Feb 2022 14:34:59 -0500 Subject: [PATCH] Avoid loading `ActionController::API` constant --- lib/jbuilder/railtie.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/jbuilder/railtie.rb b/lib/jbuilder/railtie.rb index 7ae3ad7..c4ed57a 100644 --- a/lib/jbuilder/railtie.rb +++ b/lib/jbuilder/railtie.rb @@ -16,11 +16,9 @@ module ApiRendering end end - ActiveSupport.on_load :action_controller do - if self == ActionController::API - include ActionController::Helpers - include ActionController::ImplicitRender - end + ActiveSupport.on_load :action_controller_api do + include ActionController::Helpers + include ActionController::ImplicitRender end end end