2017-07-23 11:17:16 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2004-11-23 20:04:44 -05:00
|
|
|
#--
|
2020-12-31 22:21:20 -05:00
|
|
|
# Copyright (c) 2004-2021 David Heinemeier Hansson
|
2004-11-23 20:04:44 -05:00
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
# a copy of this software and associated documentation files (the
|
|
|
|
# "Software"), to deal in the Software without restriction, including
|
|
|
|
# without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
# distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
# permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
# the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be
|
|
|
|
# included in all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
#++
|
|
|
|
|
2016-08-06 13:01:31 -04:00
|
|
|
require "abstract_controller"
|
2017-10-21 09:22:17 -04:00
|
|
|
require "action_mailer/version"
|
2008-11-25 01:41:24 -05:00
|
|
|
|
2010-05-02 07:48:46 -04:00
|
|
|
# Common Active Support usage in Action Mailer
|
2017-04-22 13:45:51 -04:00
|
|
|
require "active_support"
|
2016-08-06 13:01:31 -04:00
|
|
|
require "active_support/rails"
|
|
|
|
require "active_support/core_ext/class"
|
|
|
|
require "active_support/core_ext/module/attr_internal"
|
|
|
|
require "active_support/core_ext/string/inflections"
|
|
|
|
require "active_support/lazy_load_hooks"
|
2010-01-29 10:16:01 -05:00
|
|
|
|
2008-11-23 13:27:25 -05:00
|
|
|
module ActionMailer
|
2009-12-02 23:01:01 -05:00
|
|
|
extend ::ActiveSupport::Autoload
|
|
|
|
|
2012-08-01 14:54:22 -04:00
|
|
|
eager_autoload do
|
|
|
|
autoload :Collector
|
|
|
|
end
|
|
|
|
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :Base
|
2010-01-19 09:34:58 -05:00
|
|
|
autoload :DeliveryMethods
|
2015-05-04 14:46:51 -04:00
|
|
|
autoload :InlinePreviewInterceptor
|
2009-12-16 20:23:08 -05:00
|
|
|
autoload :MailHelper
|
2017-01-28 05:20:46 -05:00
|
|
|
autoload :Parameterized
|
2013-12-16 00:52:58 -05:00
|
|
|
autoload :Preview
|
2016-08-06 13:01:31 -04:00
|
|
|
autoload :Previews, "action_mailer/preview"
|
2009-12-27 06:09:20 -05:00
|
|
|
autoload :TestCase
|
2009-12-02 23:01:01 -05:00
|
|
|
autoload :TestHelper
|
2014-08-13 17:50:38 -04:00
|
|
|
autoload :MessageDelivery
|
2020-05-12 15:20:07 -04:00
|
|
|
autoload :DeliveryJob
|
2018-11-30 17:33:35 -05:00
|
|
|
autoload :MailDeliveryJob
|
2018-05-23 16:50:36 -04:00
|
|
|
|
|
|
|
def self.eager_load!
|
|
|
|
super
|
|
|
|
|
|
|
|
require "mail"
|
|
|
|
Mail.eager_autoload!
|
|
|
|
end
|
2008-11-23 13:27:25 -05:00
|
|
|
end
|
2015-09-09 08:44:12 -04:00
|
|
|
|
2016-08-06 13:01:31 -04:00
|
|
|
autoload :Mime, "action_dispatch/http/mime_type"
|
2015-09-09 08:44:12 -04:00
|
|
|
|
|
|
|
ActiveSupport.on_load(:action_view) do
|
|
|
|
ActionView::Base.default_formats ||= Mime::SET.symbols
|
|
|
|
ActionView::Template::Types.delegate_to Mime
|
2020-05-20 21:38:00 -04:00
|
|
|
ActionView::LookupContext::DetailsKey.clear
|
2015-09-09 08:44:12 -04:00
|
|
|
end
|