File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
actionmailer/lib/action_mailer Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,6 @@ class Railtie < Rails::Railtie # :nodoc:
45
45
46
46
options . each { |k , v | send ( "#{ k } =" , v ) }
47
47
48
- if options . show_previews
49
- app . routes . prepend do
50
- get '/rails/mailers' => "rails/mailers#index" , internal : true
51
- get '/rails/mailers/*path' => "rails/mailers#preview" , internal : true
52
- end
53
- end
54
-
55
48
ActionDispatch ::IntegrationTest . send :include , ActionMailer ::TestCase ::ClearTestDeliveries
56
49
end
57
50
end
@@ -62,9 +55,18 @@ class Railtie < Rails::Railtie # :nodoc:
62
55
end
63
56
end
64
57
65
- config . after_initialize do
66
- if ActionMailer ::Base . preview_path
67
- ActiveSupport ::Dependencies . autoload_paths << ActionMailer ::Base . preview_path
58
+ config . after_initialize do |app |
59
+ options = app . config . action_mailer
60
+
61
+ if options . show_previews
62
+ app . routes . prepend do
63
+ get '/rails/mailers' => "rails/mailers#index" , internal : true
64
+ get '/rails/mailers/*path' => "rails/mailers#preview" , internal : true
65
+ end
66
+
67
+ if options . preview_path
68
+ ActiveSupport ::Dependencies . autoload_paths << options . preview_path
69
+ end
68
70
end
69
71
end
70
72
end
You can’t perform that action at this time.
0 commit comments