提交 c8e29987 编写于 作者: M Mikel Lindsaar

First pass on fixing delivery method

上级 d201d394
......@@ -354,7 +354,8 @@ class Base < AbstractController::Base
# Alias controller_path to mailer_name so render :partial in views work.
alias :controller_path :mailer_name
class_inheritable_accessor :delivery_method
superclass_delegating_accessor :delivery_method
self.delivery_method = :smtp
class << self
......@@ -369,12 +370,6 @@ def delivery_settings
@delivery_settings ||= {:file => {:location => defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails"}}
end
# Setup the default settings for Mail delivery
Mail.defaults do
method = ActionMailer::Base.delivery_method ||= :smtp
delivery_method method
end
alias :controller_path :mailer_name
def respond_to?(method_symbol, include_private = false) #:nodoc:
......@@ -390,6 +385,7 @@ def method_missing(method_symbol, *parameters) #:nodoc:
else super
end
elsif match = matches_settings_method?(method_symbol)
# TODO Deprecation warning
delivery_settings[match[1].to_sym] = parameters[0]
else
super
......@@ -463,7 +459,7 @@ def set_payload_for_mail(payload, mail) #:nodoc:
end
private
def get_delivery_settings(method) #:nodoc:
method.is_a?(Symbol) ? delivery_settings[method] : delivery_settings[:custom]
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册