diff options
author | utilum <oz@utilum.com> | 2019-02-01 00:46:11 +0100 |
---|---|---|
committer | utilum <oz@utilum.com> | 2019-02-13 02:11:21 +0100 |
commit | 87a5379b422d38ea8766af1537593af44b6dffc6 (patch) | |
tree | f77e757600a1ef91ab5a21cfa955036ece8c1fb6 /actionmailer | |
parent | 8d9d46fdae4502b8881eca641c51a64ee7804194 (diff) | |
download | rails-87a5379b422d38ea8766af1537593af44b6dffc6.tar.gz rails-87a5379b422d38ea8766af1537593af44b6dffc6.tar.bz2 rails-87a5379b422d38ea8766af1537593af44b6dffc6.zip |
Ruby 2.7 warning: creating a Proc without a block
As of [Revision 66772](
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772)
`Proc.new` without giving a block emits `warning: tried to create Proc object without a block`.
This commit fixes cases where Rails test suit tickles this warning.
See CI logs:
https://travis-ci.org/rails/rails/jobs/487205819#L1161-L1190
https://travis-ci.org/rails/rails/jobs/487205821#L1154-1159
https://travis-ci.org/rails/rails/jobs/487205821#L1160-L1169
https://travis-ci.org/rails/rails/jobs/487205821#L1189
https://travis-ci.org/rails/rails/jobs/487254404#L1307-L1416
https://travis-ci.org/rails/rails/jobs/487254405#L1174-L1191
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 5610212fad..099e98131f 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -944,9 +944,9 @@ module ActionMailer assignable.each { |k, v| message[k] = v } end - def collect_responses(headers) + def collect_responses(headers, &block) if block_given? - collect_responses_from_block(headers, &Proc.new) + collect_responses_from_block(headers, &block) elsif headers[:body] collect_responses_from_text(headers) else |