From e899dfac47e4667305d6f6db3f0ecacae44b3bdd Mon Sep 17 00:00:00 2001 From: Ryan Buckley Date: Wed, 2 Dec 2015 22:35:03 -1000 Subject: [PATCH 1/2] Replace ActionMailer::Base#respond_to? with respond_to_missing? --- actionmailer/lib/action_mailer/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 0b128606196cf..ea07c951f4dc0 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -541,8 +541,8 @@ def deliver_mail(mail) #:nodoc: end end - def respond_to?(method, include_private = false) #:nodoc: - super || action_methods.include?(method.to_s) + def respond_to_missing?(method, include_private = false) #:nodoc: + action_methods.include?(method.to_s) end protected From 50593cc205fbcc0d2cec1d12d28a35ed6ceb3c2a Mon Sep 17 00:00:00 2001 From: Ryan Buckley Date: Thu, 3 Dec 2015 10:34:21 -1000 Subject: [PATCH 2/2] Make ActionMailer::Base.respond_to_missing? private --- actionmailer/lib/action_mailer/base.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index ea07c951f4dc0..cbbf480da8ddd 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -541,10 +541,6 @@ def deliver_mail(mail) #:nodoc: end end - def respond_to_missing?(method, include_private = false) #:nodoc: - action_methods.include?(method.to_s) - end - protected def set_payload_for_mail(payload, mail) #:nodoc: @@ -566,6 +562,12 @@ def method_missing(method_name, *args) # :nodoc: super end end + + private + + def respond_to_missing?(method, include_all = false) #:nodoc: + action_methods.include?(method.to_s) + end end attr_internal :message