diff options
author | Manfred Stienstra <manfred@fngtps.com> | 2008-09-21 17:29:22 +0200 |
---|---|---|
committer | Manfred Stienstra <manfred@fngtps.com> | 2008-09-21 17:29:22 +0200 |
commit | 809af7f5586cb3f2f913b21be168fbf72d58cbfe (patch) | |
tree | 6b961ab0925be177dfb4d1e269ca966db5a70dfa /activesupport/lib/active_support/multibyte/chars.rb | |
parent | b8eec5ac33d6f421fe5a2c757794ed2e4965f81d (diff) | |
download | rails-809af7f5586cb3f2f913b21be168fbf72d58cbfe.tar.gz rails-809af7f5586cb3f2f913b21be168fbf72d58cbfe.tar.bz2 rails-809af7f5586cb3f2f913b21be168fbf72d58cbfe.zip |
Non-string results from forwarded methods should be returned vertabim.
Diffstat (limited to 'activesupport/lib/active_support/multibyte/chars.rb')
-rw-r--r-- | activesupport/lib/active_support/multibyte/chars.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index c61367968e..b3fdcdc650 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -106,10 +106,11 @@ module ActiveSupport #:nodoc: @wrapped_string.__send__(method, *args, &block) self else - chars(@wrapped_string.__send__(method, *args, &block)) + result = @wrapped_string.__send__(method, *args, &block) + result.kind_of?(String) ? chars(result) : result end end - + # Returns +true+ if _obj_ responds to the given method. Private methods are included in the search # only if the optional second parameter evaluates to +true+. def respond_to?(method, include_private=false) |