From 071882e8ef6835cec7eb4e6ff965b99f4563b7aa Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Sun, 9 Apr 2017 19:53:31 +0930 Subject: delegate_to_missing doesn't delegate private methods So we shouldn't claim they're there, even when asked explicitly. --- activesupport/lib/active_support/core_ext/module/delegation.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/core_ext/module') diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index cdf27f49ad..ee2c3f54d1 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -267,7 +267,10 @@ class Module module_eval <<-RUBY, __FILE__, __LINE__ + 1 def respond_to_missing?(name, include_private = false) - #{target}.respond_to?(name, include_private) + # It may look like an oversight, but we deliberately do not pass + # +include_private+, because they do not get delegated. + + #{target}.respond_to?(name) end def method_missing(method, *args, &block) -- cgit v1.2.3