diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-19 23:36:49 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-01-19 23:36:49 +1100 |
commit | c8e2998701653df9035232778d60f18c4a07abb4 (patch) | |
tree | 763f8bfbb7c24a20b07600ed819c2ed20e9b752b /actionmailer | |
parent | d201d39437c754fa38b14dd4168fab601399918e (diff) | |
download | rails-c8e2998701653df9035232778d60f18c4a07abb4.tar.gz rails-c8e2998701653df9035232778d60f18c4a07abb4.tar.bz2 rails-c8e2998701653df9035232778d60f18c4a07abb4.zip |
First pass on fixing delivery method
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index fd251ff223..082560e695 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -354,7 +354,8 @@ module ActionMailer #:nodoc: # 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 @@ module ActionMailer #:nodoc: @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 @@ module ActionMailer #: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 @@ module ActionMailer #:nodoc: end private - + def get_delivery_settings(method) #:nodoc: method.is_a?(Symbol) ? delivery_settings[method] : delivery_settings[:custom] end |