Is there a way using a Rails 3 initializer to make all application emails sent out by delayed_job by default?
I tried something like this:
# confi开发者_运维百科g/initializers/delayed_mailer.rb
class ActionMailer::Base
Delayed::Worker
end
But it errors with:
execution expired
Can you override ActionMailer::Base.deliver
to do Delayed::Job.enqueue self
? Also, take out Delayed::Worker, I think that's run via the rake task to pop things off the queue. Also, if you're going to monkey patch things, make note of it in initializers or make a patches directory that is read by an initializer.
精彩评论