diff options
author | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-25 21:47:03 +1100 |
---|---|---|
committer | José Valim and Mikel Lindsaar <pair@programming.com> | 2010-01-25 21:47:03 +1100 |
commit | ace74974cf3575bbd3bf7ff4d8a83c3100fd22a9 (patch) | |
tree | ee3f53d8257623cd8544eee40528ddea74096a33 /actionmailer/lib | |
parent | 4240369a4399b944a0652807c545ffe99d7fb0cd (diff) | |
download | rails-ace74974cf3575bbd3bf7ff4d8a83c3100fd22a9.tar.gz rails-ace74974cf3575bbd3bf7ff4d8a83c3100fd22a9.tar.bz2 rails-ace74974cf3575bbd3bf7ff4d8a83c3100fd22a9.zip |
Got AM working with Mail yield on delivery_handler and updated tests
Diffstat (limited to 'actionmailer/lib')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 9 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/delivery_methods.rb | 4 |
2 files changed, 3 insertions, 10 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 4e5e1bbb29..47d0ffaf68 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -330,14 +330,7 @@ module ActionMailer #:nodoc: ActiveSupport::Notifications.instrument("action_mailer.deliver") do |payload| self.set_payload_for_mail(payload, mail) - if mail.perform_deliveries - begin - mail.deliver! - rescue Exception => e - raise e if mail.raise_delivery_errors - end - Mail.deliveries << mail - end + yield # Let Mail do the delivery actions end end diff --git a/actionmailer/lib/action_mailer/delivery_methods.rb b/actionmailer/lib/action_mailer/delivery_methods.rb index 7a6b410932..34bfe6000a 100644 --- a/actionmailer/lib/action_mailer/delivery_methods.rb +++ b/actionmailer/lib/action_mailer/delivery_methods.rb @@ -40,8 +40,8 @@ module ActionMailer end module ClassMethods - # Provides a list of emails that have been delivered by Mail - delegate :deliveries, :deliveries=, :to => Mail + # Provides a list of emails that have been delivered by Mail::TestMailer + delegate :deliveries, :deliveries=, :to => Mail::TestMailer # Adds a new delivery method through the given class using the given symbol # as alias and the default options supplied: |