diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 11:02:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 11:02:42 -0700 |
commit | 63625388154043dd6cde755f62c095dad87ad173 (patch) | |
tree | dddbe0649873c1841cdaade80ffb6a8bfacf5560 /activesupport/lib/active_support | |
parent | ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a (diff) | |
download | rails-63625388154043dd6cde755f62c095dad87ad173.tar.gz rails-63625388154043dd6cde755f62c095dad87ad173.tar.bz2 rails-63625388154043dd6cde755f62c095dad87ad173.zip |
add more tests surrounding camlize in xmlmini, refactor rename_key()
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/xml_mini.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb index a1728ab955..cddfcddb57 100644 --- a/activesupport/lib/active_support/xml_mini.rb +++ b/activesupport/lib/active_support/xml_mini.rb @@ -126,14 +126,10 @@ module ActiveSupport end def rename_key(key, options = {}) - camelize = options.has_key?(:camelize) && options[:camelize] + camelize = options[:camelize] dasherize = !options.has_key?(:dasherize) || options[:dasherize] if camelize - if options[:camelize] == :lower - key = key.camelize(:lower) - else - key = key.camelize - end + key = true == camelize ? key.camelize : key.camelize(camelize) end key = _dasherize(key) if dasherize key |