From 4387f9724273ee477ff60876b360d0abcee0e344 Mon Sep 17 00:00:00 2001 From: Norman Clarke Date: Thu, 5 Jan 2012 11:40:01 -0300 Subject: Override #slice! to ensure proper return value. The default pass-through to `method_missing` makes `#slice!` return `self` rather than the string that was sliced off. --- activesupport/lib/active_support/multibyte/chars.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/multibyte/chars.rb b/activesupport/lib/active_support/multibyte/chars.rb index 266cfc2eda..9ca977012c 100644 --- a/activesupport/lib/active_support/multibyte/chars.rb +++ b/activesupport/lib/active_support/multibyte/chars.rb @@ -142,6 +142,10 @@ module ActiveSupport #:nodoc: end end + def slice!(*args) + chars(@wrapped_string.slice!(*args)) + end + # Reverses all characters in the string. # # Example: -- cgit v1.2.3