aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/multibyte
diff options
context:
space:
mode:
authorNorman Clarke <norman@njclarke.com>2012-01-05 11:40:01 -0300
committerNorman Clarke <norman@njclarke.com>2012-01-05 11:42:03 -0300
commit4387f9724273ee477ff60876b360d0abcee0e344 (patch)
tree9c6c040453cefcd25faf68a00a3b2e5af5f152a3 /activesupport/lib/active_support/multibyte
parent5fb5ced0cba3306e0f39e45eb299fd0ea32cdd4b (diff)
downloadrails-4387f9724273ee477ff60876b360d0abcee0e344.tar.gz
rails-4387f9724273ee477ff60876b360d0abcee0e344.tar.bz2
rails-4387f9724273ee477ff60876b360d0abcee0e344.zip
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.
Diffstat (limited to 'activesupport/lib/active_support/multibyte')
-rw-r--r--activesupport/lib/active_support/multibyte/chars.rb4
1 files changed, 4 insertions, 0 deletions
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: