This project is archived and is in readonly mode.
TimeWithZones aren't serialized properly in Hash#to_xml
Reported by Jonathan del Strother | March 12th, 2009 @ 06:08 PM | in 2.x
Attempting to convert a hash containing TimeWithZone objects to xml :
{:time => Time.now.in_time_zone}.to_xml
will give datetimes that don't match iso8601
This patch adds ActiveSupport::TimeWithZone to the list of XML_TYPE_NAMES, so that TimeWithZone#xmlschema is used when serializing them.
Comments and changes to this ticket
-
Pratik March 12th, 2009 @ 06:18 PM
- Tag set to patch
- Title changed from [PATCH] TimeWithZones aren't serialized properly in Hash#to_xml to TimeWithZones aren't serialized properly in Hash#to_xml
-
Repository March 12th, 2009 @ 06:37 PM
- State changed from new to resolved
(from [923067810480c93817dbae3d8295a18aa2a2ec3a]) 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 pratiknaik@gmail.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 2223 TimeWithZones aren't serialized properly in Hash#to_xml (from [923067810480c93817dbae3d8295a18aa2a2ec3a]) Use xml...