Permalink
Browse files

Fix failing xml mini test.

  • Loading branch information...
josevalim committed May 8, 2011
1 parent 67c3469 commit ad129639c7e72c3ba686db6202a4bff2cb2cfbfe
Showing with 4 additions and 1 deletion.
  1. +4 −1 activesupport/lib/active_support/xml_mini.rb
@@ -139,7 +139,10 @@ def rename_key(key, options = {})
protected
def _dasherize(key)
- key.gsub(/(?!^[_]*)_(?![_]*$)/, '-')
+ left = key.strip.rpartition(/^_*/)
+ right = left.pop.partition(/_*$/)
+ right.first.tr!('_ ', '--')
+ left.concat(right).join
end
# TODO: Add support for other encodings

0 comments on commit ad12963

Please sign in to comment.