Skip to content

Commit af724d9

Browse files
authored
Update railtie.rb
Fix `undefined method 'detach_from' for class ActionController::LogSubscriber (NoMethodError)`
1 parent 4a840ae commit af724d9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/console/adapter/rails/railtie.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
# Copyright, 2024, by Michael Adams.
55
# Copyright, 2024, by Samuel Williams.
66

7-
require 'action_controller/log_subscriber'
8-
require 'action_view/log_subscriber'
7+
require 'active_support/log_subscriber'
98

109
module Console
1110
module Adapter
@@ -22,10 +21,10 @@ class Railtie < ::Rails::Railtie
2221

2322
# 3. Remove existing log subscribers for ActionController and ActionView
2423
config.after_initialize do
25-
::ActionController::LogSubscriber.detach_from :action_controller
24+
::ActiveSupport::LogSubscriber.detach_from :action_controller
2625

2726
# Silence the default action view logs, e.g. "Rendering text template" etc
28-
::ActionView::LogSubscriber.detach_from :action_view
27+
::ActiveSupport::LogSubscriber.detach_from :action_view
2928
end
3029

3130
config.after_initialize do

0 commit comments

Comments
 (0)