diff options
author | José Valim <jose.valim@gmail.com> | 2009-08-13 10:27:53 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-08-13 10:27:53 +0200 |
commit | 8692b11e81ab2df2e4122c2f47d91e5eaaf508f2 (patch) | |
tree | 695173d98666ddf3554ee380849a750d353d3314 /activesupport/lib/active_support/core_ext/module | |
parent | 4f9047ecc8f0e2c3d4491bae0051679569da71dc (diff) | |
parent | f413a703ba5bcf4b369932ae805615c4a34d34cb (diff) | |
download | rails-8692b11e81ab2df2e4122c2f47d91e5eaaf508f2.tar.gz rails-8692b11e81ab2df2e4122c2f47d91e5eaaf508f2.tar.bz2 rails-8692b11e81ab2df2e4122c2f47d91e5eaaf508f2.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 11e01437aa..df8aefea5a 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -120,10 +120,15 @@ class Module end module_eval(<<-EOS, file, line) - def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block) - #{on_nil} if #{to}.nil? - #{to}.__send__(#{method.inspect}, *args, &block) # client && client.__send__(:name, *args, &block) - end # end + def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block) + #{to}.__send__(#{method.inspect}, *args, &block) # client.__send__(:name, *args, &block) + rescue NoMethodError # rescue NoMethodError + if #{to}.nil? # if client.nil? + #{on_nil} + else # else + raise # raise + end # end + end # end EOS end end |