aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorManfred Stienstra <manfred@fngtps.com>2008-09-21 17:29:22 +0200
committerManfred Stienstra <manfred@fngtps.com>2008-09-21 17:29:22 +0200
commit809af7f5586cb3f2f913b21be168fbf72d58cbfe (patch)
tree6b961ab0925be177dfb4d1e269ca966db5a70dfa /activesupport/lib
parentb8eec5ac33d6f421fe5a2c757794ed2e4965f81d (diff)
downloadrails-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')
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb5
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)