diff options
author | Cristian Bica <cristian.bica@gmail.com> | 2014-08-20 11:34:57 +0300 |
---|---|---|
committer | Cristian Bica <cristian.bica@gmail.com> | 2014-08-20 17:48:34 +0300 |
commit | f4ee114746ddc68db606f63e17e6de28274fc2bd (patch) | |
tree | 2c4f1b4d3cbd0746c88aac178a3b90eae95d3543 /actionmailer/lib/action_mailer | |
parent | 500deece9ef511c59a8c6edc7fb8682b13c4cd7e (diff) | |
download | rails-f4ee114746ddc68db606f63e17e6de28274fc2bd.tar.gz rails-f4ee114746ddc68db606f63e17e6de28274fc2bd.tar.bz2 rails-f4ee114746ddc68db606f63e17e6de28274fc2bd.zip |
Deprecated .deliver / .deliver! to .deliver_now / .deliver_now!
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/message_delivery.rb | 24 |
1 files changed, 22 insertions, 2 deletions
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 |