diff options
author | Lauro Caetano <laurocaetano1@gmail.com> | 2013-11-28 23:59:49 -0200 |
---|---|---|
committer | Lauro Caetano <laurocaetano1@gmail.com> | 2013-11-29 13:08:52 -0200 |
commit | e40ac155cadac5162a802f3e36a66198f215417d (patch) | |
tree | 47ba98b0677ee691671a46b327174ef5074ea828 | |
parent | 948c0ff1647eb3dd1b45add0d1748d393cd2fd50 (diff) | |
download | rails-e40ac155cadac5162a802f3e36a66198f215417d.tar.gz rails-e40ac155cadac5162a802f3e36a66198f215417d.tar.bz2 rails-e40ac155cadac5162a802f3e36a66198f215417d.zip |
Improve Module#delegate documentation to tell that delegate don't work with private or protected methods. [ci skip]
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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] |