1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix failing xml mini test.

This commit is contained in:
José Valim 2011-05-08 12:25:02 +02:00
parent 67c3469e6f
commit ad129639c7

View file

@ -139,7 +139,10 @@ module ActiveSupport
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