From 923067810480c93817dbae3d8295a18aa2a2ec3a Mon Sep 17 00:00:00 2001 From: Jonathan del Strother Date: Thu, 12 Mar 2009 17:53:16 +0000 Subject: Use xmlschema when serializing TimeWithZones to xml [#2223 state:resolved] When using Hash#to_xml, any TimeWithZone objects now use xmlschema (iso8601), rather than a simple TimeWithZone#to_s. Signed-off-by: Pratik Naik --- activesupport/lib/active_support/core_ext/hash/conversions.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb index 991a5a6a89..10435975c5 100644 --- a/activesupport/lib/active_support/core_ext/hash/conversions.rb +++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb @@ -24,11 +24,12 @@ module ActiveSupport #:nodoc: "Bignum" => "integer", "BigDecimal" => "decimal", "Float" => "float", + "TrueClass" => "boolean", + "FalseClass" => "boolean", "Date" => "date", "DateTime" => "datetime", "Time" => "datetime", - "TrueClass" => "boolean", - "FalseClass" => "boolean" + "ActiveSupport::TimeWithZone" => "datetime" } unless defined?(XML_TYPE_NAMES) XML_FORMATTING = { -- cgit v1.2.3