From f4ee114746ddc68db606f63e17e6de28274fc2bd Mon Sep 17 00:00:00 2001 From: Cristian Bica Date: Wed, 20 Aug 2014 11:34:57 +0300 Subject: Deprecated .deliver / .deliver! to .deliver_now / .deliver_now! --- actionmailer/lib/action_mailer/message_delivery.rb | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'actionmailer/lib/action_mailer') diff --git a/actionmailer/lib/action_mailer/message_delivery.rb b/actionmailer/lib/action_mailer/message_delivery.rb index 80a0517bff..8136483725 100644 --- a/actionmailer/lib/action_mailer/message_delivery.rb +++ b/actionmailer/lib/action_mailer/message_delivery.rb @@ -21,11 +21,31 @@ module ActionMailer end def deliver_later!(options={}) - enqueue_delivery :deliver!, options + enqueue_delivery :deliver_now!, options end def deliver_later(options={}) - enqueue_delivery :deliver, options + enqueue_delivery :deliver_now, options + end + + def deliver_now! + message.deliver! + end + + def deliver_now + message.deliver + end + + def deliver! + ActiveSupport::Deprecation.warn "#deliver! is deprecated and will be removed on Rails 5. " \ + "Use #deliver_now! to deliver immediately or #deliver_later! to deliver through ActiveJob" + deliver_now! + end + + def deliver + ActiveSupport::Deprecation.warn "#deliver is deprecated and will be removed on Rails 5. " \ + "Use #deliver_now to deliver immediately or #deliver_later to deliver through ActiveJob" + deliver_now end private -- cgit v1.2.3