diff options
author | Jeremy Holland <jeremy@jeremypholland.com> | 2010-10-31 22:16:55 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 10:43:45 -0700 |
commit | ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a (patch) | |
tree | 288788e1c0fdcbc744b856ae462aee95c8d6a5c6 /activesupport/lib | |
parent | 208fb2920d6c6c6be97a7086cea24f4c8220010c (diff) | |
download | rails-ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a.tar.gz rails-ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a.tar.bz2 rails-ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a.zip |
Allowing to_xml :camelize option to be set to :lower to enable lower-camelcase tags [#5903 state:resolved]
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/xml_mini.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index b6a8cf3caf..a1728ab955 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -128,7 +128,13 @@ module ActiveSupport def rename_key(key, options = {}) camelize = options.has_key?(:camelize) && options[:camelize] dasherize = !options.has_key?(:dasherize) || options[:dasherize] - key = key.camelize if camelize + if camelize + if options[:camelize] == :lower + key = key.camelize(:lower) + else + key = key.camelize + end + end key = _dasherize(key) if dasherize key end |