mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Load AV::Layout to AM::Base in railties
This commit is contained in:
parent
2a25c4ce6d
commit
d1760253f5
5 changed files with 16 additions and 2 deletions
|
@ -368,8 +368,6 @@ module ActionMailer
|
|||
|
||||
include AbstractController::Rendering
|
||||
|
||||
include ActionView::Layouts
|
||||
|
||||
include AbstractController::Logger
|
||||
include AbstractController::Helpers
|
||||
include AbstractController::Translation
|
||||
|
|
|
@ -13,6 +13,9 @@ require 'action_mailer'
|
|||
require 'action_mailer/test_case'
|
||||
require 'mail'
|
||||
|
||||
# Emulate AV railtie
|
||||
ActionMailer::Base.send(:include, ActionView::Layouts)
|
||||
|
||||
# Show backtraces for deprecated behavior for quicker cleanup.
|
||||
ActiveSupport::Deprecation.debug = true
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'abstract_unit'
|
||||
require 'action_view'
|
||||
require 'action_controller'
|
||||
|
||||
class I18nTestMailer < ActionMailer::Base
|
||||
|
@ -14,6 +15,9 @@ class I18nTestMailer < ActionMailer::Base
|
|||
end
|
||||
end
|
||||
|
||||
# Emulate AV railtie
|
||||
ActionController::Base.superclass.send(:include, ActionView::Layouts)
|
||||
|
||||
class TestController < ActionController::Base
|
||||
def send_mail
|
||||
I18nTestMailer.mail_with_i18n_subject("test@localhost").deliver
|
||||
|
|
|
@ -8,6 +8,9 @@ require 'abstract_unit'
|
|||
require 'controller/fake_controllers'
|
||||
|
||||
require 'action_mailer'
|
||||
require 'action_view'
|
||||
|
||||
ActionMailer::Base.send(:include, ActionView::Layouts)
|
||||
ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH
|
||||
|
||||
class AssertSelectTest < ActionController::TestCase
|
||||
|
|
|
@ -41,5 +41,11 @@ module ActionView
|
|||
ActionController::Base.superclass.send(:include, ActionView::Layouts)
|
||||
end
|
||||
end
|
||||
|
||||
initializer "action_view.setup_action_mailer" do |app|
|
||||
ActiveSupport.on_load(:action_mailer) do
|
||||
ActionMailer::Base.send(:include, ActionView::Layouts)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue