diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-10-30 14:53:05 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-10-30 14:53:19 -0700 |
commit | e76c38ef1047ad3ffb25c1c639c38432a9228796 (patch) | |
tree | 207b7e10addd34d8c44f5d3d53ce3c3a65762ad2 /actionmailer/lib/action_mailer/message_delivery.rb | |
parent | d2315d0c3b1ede89b7cce6a77c647285359243c5 (diff) | |
download | rails-e76c38ef1047ad3ffb25c1c639c38432a9228796.tar.gz rails-e76c38ef1047ad3ffb25c1c639c38432a9228796.tar.bz2 rails-e76c38ef1047ad3ffb25c1c639c38432a9228796.zip |
split `process` from mailer instantiation
this allows us to construct mailer objects without possibly disastrous
side-effects.
Diffstat (limited to 'actionmailer/lib/action_mailer/message_delivery.rb')
-rw-r--r-- | actionmailer/lib/action_mailer/message_delivery.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/message_delivery.rb b/actionmailer/lib/action_mailer/message_delivery.rb index 622d481113..5fcb5a0c88 100644 --- a/actionmailer/lib/action_mailer/message_delivery.rb +++ b/actionmailer/lib/action_mailer/message_delivery.rb @@ -21,7 +21,11 @@ module ActionMailer end def __getobj__ #:nodoc: - @obj ||= @mailer.send(:new, @mail_method, *@args).message + @obj ||= begin + mailer = @mailer.new + mailer.process @mail_method, *@args + mailer.message + end end def __setobj__(obj) #:nodoc: |