aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/hash
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/hash')
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index de67b0b00d..65047b2d3c 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -6,13 +6,15 @@ module ActiveSupport #:nodoc:
module Hash #:nodoc:
module Conversions
XML_TYPE_NAMES = {
- ::Fixnum => "integer",
- ::Float => "float",
- ::Date => "date",
- ::DateTime => "datetime",
- ::Time => "datetime",
- ::TrueClass => "boolean",
- ::FalseClass => "boolean"
+ "Fixnum" => "integer",
+ "Bignum" => "integer",
+ "BigDecimal" => "numeric",
+ "Float" => "float",
+ "Date" => "date",
+ "DateTime" => "datetime",
+ "Time" => "datetime",
+ "TrueClass" => "boolean",
+ "FalseClass" => "boolean"
} unless defined? XML_TYPE_NAMES
XML_FORMATTING = {
@@ -56,7 +58,7 @@ module ActiveSupport #:nodoc:
if value.respond_to?(:to_xml)
value.to_xml(options.merge({ :root => key, :skip_instruct => true }))
else
- type_name = XML_TYPE_NAMES[value.class]
+ type_name = XML_TYPE_NAMES[value.class.name]
key = dasherize ? key.to_s.dasherize : key.to_s