diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2018-11-05 16:36:21 -0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2018-11-05 16:36:21 -0800 |
commit | 874446cd72f9edac60deb8dcd91cf2f019b5347c (patch) | |
tree | 6f91b3f33f8e557e46b0986f1275a30506bc1832 /lib/action_mailbox/router | |
parent | 152a442b1902050265ddcef56f5506b3bfbb12e4 (diff) | |
download | rails-874446cd72f9edac60deb8dcd91cf2f019b5347c.tar.gz rails-874446cd72f9edac60deb8dcd91cf2f019b5347c.tar.bz2 rails-874446cd72f9edac60deb8dcd91cf2f019b5347c.zip |
Extract Mail-bound methods into mail_ext for future upstream work
Diffstat (limited to 'lib/action_mailbox/router')
-rw-r--r-- | lib/action_mailbox/router/route.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/action_mailbox/router/route.rb b/lib/action_mailbox/router/route.rb index 34cc684381..24be8d4804 100644 --- a/lib/action_mailbox/router/route.rb +++ b/lib/action_mailbox/router/route.rb @@ -10,9 +10,9 @@ class ActionMailbox::Router::Route def match?(inbound_email) case address when String - recipients_from(inbound_email.mail).any? { |recipient| address.casecmp?(recipient) } + inbound_email.mail.recipients.any? { |recipient| address.casecmp?(recipient) } when Regexp - recipients_from(inbound_email.mail).any? { |recipient| address.match?(recipient) } + inbound_email.mail.recipients.any? { |recipient| address.match?(recipient) } when Proc address.call(inbound_email) else @@ -30,8 +30,4 @@ class ActionMailbox::Router::Route raise ArgumentError, "Expected a String, Regexp, Proc, or matchable, got #{address.inspect}" end end - - def recipients_from(mail) - Array(mail.to) + Array(mail.cc) + Array(mail.bcc) - end end |