aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailbox
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2019-08-01 16:41:26 +0900
committerAkira Matsuda <ronnie@dio.jp>2019-08-01 17:58:00 +0900
commitaf2129b4c74732c88ffce76e5c55c805cb9431f6 (patch)
treec74d8c85f81ea6b3a5e4209be247c9d83666bd4d /actionmailbox
parentdbf3e4882f9da95e34ed9086f182cf424aaac224 (diff)
downloadrails-af2129b4c74732c88ffce76e5c55c805cb9431f6.tar.gz
rails-af2129b4c74732c88ffce76e5c55c805cb9431f6.tar.bz2
rails-af2129b4c74732c88ffce76e5c55c805cb9431f6.zip
Use `try` only when we're unsure if the receiver would respond_to the method
Diffstat (limited to 'actionmailbox')
-rw-r--r--actionmailbox/lib/action_mailbox/router.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionmailbox/lib/action_mailbox/router.rb b/actionmailbox/lib/action_mailbox/router.rb
index 54982eae21..9ac58e5b3f 100644
--- a/actionmailbox/lib/action_mailbox/router.rb
+++ b/actionmailbox/lib/action_mailbox/router.rb
@@ -31,7 +31,7 @@ module ActionMailbox
end
def mailbox_for(inbound_email)
- routes.detect { |route| route.match?(inbound_email) }.try(:mailbox_class)
+ routes.detect { |route| route.match?(inbound_email) }&.mailbox_class
end
private