File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
actiontext/lib/action_text Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,6 @@ def to_trix_content_attachment_partial_path
59
59
end
60
60
61
61
initializer "action_text.renderer" do
62
- ActiveSupport . on_load ( :action_controller_base ) do
63
- ActiveSupport . on_load ( :action_text_content ) do
64
- self . default_renderer = Class . new ( ActionController ::Base ) . renderer
65
- end
66
- end
67
-
68
62
%i[ action_controller_base action_mailer ] . each do |base |
69
63
ActiveSupport . on_load ( base ) do
70
64
around_action do |controller , action |
Original file line number Diff line number Diff line change @@ -8,12 +8,15 @@ module Rendering # :nodoc:
8
8
extend ActiveSupport ::Concern
9
9
10
10
included do
11
- cattr_accessor :default_renderer , instance_accessor : false
12
11
thread_cattr_accessor :renderer , instance_accessor : false
13
12
delegate :render , to : :class
14
13
end
15
14
16
15
class_methods do
16
+ def action_controller_renderer
17
+ @action_controller_renderer ||= Class . new ( ActionController ::Base ) . renderer
18
+ end
19
+
17
20
def with_renderer ( renderer )
18
21
previous_renderer = self . renderer
19
22
self . renderer = renderer
@@ -23,7 +26,7 @@ def with_renderer(renderer)
23
26
end
24
27
25
28
def render ( *args , &block )
26
- ( renderer || default_renderer ) . render_to_string ( *args , &block )
29
+ ( renderer || action_controller_renderer ) . render_to_string ( *args , &block )
27
30
end
28
31
end
29
32
end
You can’t perform that action at this time.
0 commit comments