I am extracting a standalone batch application from a Rails 3.0.1
project. This requires only ActiveRecord and ActionMailer. In my
testing I set

ActionMailer::Base.delivery_method = :test

This causes the mail to be delivered to the
ActionMailer::Base.deliveries array. However, I am getting two of the
test email messages placed in the deliveries array instead of just one.
For example:

'[
#<Mail::Message:38151600,
Multipart: false,
Headers:
<Date: Wed, 05 Dec 2012 16:05:16 -0500>,
<From: forex.control@harte-lyne.ca>,
<To: forex.test@harte-lyne.ca>,
<Message-ID:
<50bfb70ca7ea9_78aa14427fc856@xnet241.hamilton.harte-lyne.ca.mail>>,
<Subject: [ForEx] 2012-12-05 - Foreign Exchange Rates Central Bank
Update Notice>,
<Mime-Version: 1.0>,
<Content-Type: text/plain>,
<Content-Transfer-Encoding: 7bit>>,

#<Mail::Message:38151600,
Multipart: false,
Headers:
<Date: Wed, 05 Dec 2012 16:05:16 -0500>,
<From: forex.control@harte-lyne.ca>,
<To: forex.test@harte-lyne.ca>,
<Message-ID:
<50bfb70ca7ea9_78aa14427fc856@xnet241.hamilton.harte-lyne.ca.mail>>,
<Subject: [ForEx] 2012-12-05 - Foreign Exchange Rates Central Bank
Update Notice>,
<Mime-Version: 1.0>,
<Content-Type: text/plain>,
<Content-Transfer-Encoding: 7bit>>
]'

I can forcibly fix this with a call to deliveries.unique but I would
rather find out what is actually happening. Wherever this is occuring
it is between the call to the mail method in the mailer class and the
return from that class back to the calling script. As I provide no
intervening code and since self.deliveries does not exist inside the
mailer class on return from the mail method I gather that this array and
method is being created and populated somewhere in the ActionMailer
stack outside of my pervue.

Does anyone have any idea why this is happening?

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 5, '12 at 9:22p
activeDec 5, '12 at 9:22p
posts1
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

James Byrne: 1 post

People

Translate

site design / logo © 2021 Grokbase