Skip to content
Permalink
Browse files

Remove deprecated ActionMailer deliver & deliver!

These methods were deprecated in Rails 4.2 (see f4ee114) so they can
be safely removed in Rails 5.0.
  • Loading branch information
claudiob authored and rafaelfranca committed Jan 3, 2015
1 parent 5f777e4 commit 755dcd0691f74079c24196135f89b917062b0715
@@ -1,3 +1,7 @@
* Remove deprecated `deliver` and `deliver!` methods.

*claudiob*

* Template lookup now respects default locale and I18n fallbacks.

Given the following templates:
@@ -85,26 +85,6 @@ def deliver_now
message.deliver
end

def deliver! #:nodoc:
ActiveSupport::Deprecation.warn(<<-MSG.squish)
`#deliver!` is deprecated and will be removed in Rails 5. Use
`#deliver_now!` to deliver immediately or `#deliver_later!` to
deliver through Active Job.
MSG

deliver_now!
end

def deliver #:nodoc:
ActiveSupport::Deprecation.warn(<<-MSG.squish)
`#deliver` is deprecated and will be removed in Rails 5. Use
`#deliver_now` to deliver immediately or `#deliver_later` to
deliver through Active Job.
MSG

deliver_now
end

private

def enqueue_delivery(delivery_method, options={})
@@ -32,25 +32,6 @@ class MessageDeliveryTest < ActiveSupport::TestCase
assert_equal Mail::Message , @mail.message.class
end

test 'should respond to .deliver' do
assert_respond_to @mail, :deliver
end

test 'should respond to .deliver!' do
assert_respond_to @mail, :deliver!
end

test '.deliver is deprecated' do
assert_deprecated do
@mail.deliver
end
end
test '.deliver! is deprecated' do
assert_deprecated do
@mail.deliver!
end
end

test 'should respond to .deliver_later' do
assert_respond_to @mail, :deliver_later
end

0 comments on commit 755dcd0

Please sign in to comment.
You can’t perform that action at this time.