diff options
author | Matthew Draper <matthew@trebex.net> | 2017-04-09 19:53:31 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2017-04-09 20:00:12 +0930 |
commit | 071882e8ef6835cec7eb4e6ff965b99f4563b7aa (patch) | |
tree | 5cccc176c6e8222395d786151d52cdd89edb99ac /activesupport/lib | |
parent | 81555776d4006f3cd31ae49e6ab385ea3327f036 (diff) | |
download | rails-071882e8ef6835cec7eb4e6ff965b99f4563b7aa.tar.gz rails-071882e8ef6835cec7eb4e6ff965b99f4563b7aa.tar.bz2 rails-071882e8ef6835cec7eb4e6ff965b99f4563b7aa.zip |
delegate_to_missing doesn't delegate private methods
So we shouldn't claim they're there, even when asked explicitly.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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) |