lib/delayed/performable_mailer.rb in delayed_job-4.0.3 vs lib/delayed/performable_mailer.rb in delayed_job-4.0.4
- old
+ new
@@ -1,10 +1,11 @@
require 'mail'
module Delayed
class PerformableMailer < PerformableMethod
def perform
- object.send(method_name, *args).deliver
+ mailer = object.send(method_name, *args)
+ mailer.respond_to?(:deliver_now) ? mailer.deliver_now : mailer.deliver
end
end
module DelayMail
def delay(options = {})