app/controllers/umlaut/controller_behavior.rb in umlaut-4.0.3 vs app/controllers/umlaut/controller_behavior.rb in umlaut-4.1.0.pre.alpha.1
- old
+ new
@@ -85,8 +85,22 @@
return specified_groups
end
protected :specified_service_groups
+ # Call an ActionMailer::Base without deprecation warnings in Rails 4.3,
+ # but still work in earlier rails without deliver_later
+ #
+ # Calls with deliver_later in Rails 4.3. If no ActiveJob queue
+ # is set up, no problem default is immediate executor anyway.
+ def action_mailer_deliver(mailer)
+ if mailer.respond_to?(:deliver_later)
+ mailer.deliver_later
+ else
+ mailer.deliver
+ end
+ end
+ protected :action_mailer_deliver
+
end