From e40ac155cadac5162a802f3e36a66198f215417d Mon Sep 17 00:00:00 2001 From: Lauro Caetano Date: Thu, 28 Nov 2013 23:59:49 -0200 Subject: Improve Module#delegate documentation to tell that delegate don't work with private or protected methods. [ci skip] --- activesupport/lib/active_support/core_ext/module/delegation.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 182e74d9e1..58146cdf7a 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -138,6 +138,8 @@ class Module # # Foo.new("Bar").name # raises NoMethodError: undefined method `name' # + # The target method must be public, otherwise it will raise +NoMethodError+. + # def delegate(*methods) options = methods.pop unless options.is_a?(Hash) && to = options[:to] -- cgit v1.2.3