Permalink
Browse files

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.
  • Loading branch information...
norman committed Jan 5, 2012
1 parent 5fb5ced commit 4387f9724273ee477ff60876b360d0abcee0e344
Showing with 4 additions and 0 deletions.
  1. +4 −0 activesupport/lib/active_support/multibyte/chars.rb
@@ -142,6 +142,10 @@ def []=(*args)
end
end
+ def slice!(*args)
+ chars(@wrapped_string.slice!(*args))
+ end
+
# Reverses all characters in the string.
#
# Example:

0 comments on commit 4387f97

Please sign in to comment.