Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10466 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

[PATCH] Ruby 1.9 compat - Fix #xmlschema tests and change DateTime#xmlschema behavior

Reported by: chuyeow Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: ruby 1.9 yarv
Cc:

Description

This patch is for ruby 1.9 compatibility but I've broken it out of the main ticket #1689 due to a change in current behavior.

Ruby 1.9 defines DateTime#xmlschema which instead of returning dates of the form 1980-02-28T15:15:10Z if the offset is 0, returns 1980-02-28T15:15:10+00:00. I propose using +00:00 so that we can rely on Ruby 1.9's native DateTime#xmlschema. Tests showing the change in format in the patch.

Other than that, the rest are 1.9 compat fixes:

  • remove_method DateTime#to_time if Ruby 1.9 since it relies internally on Time. We use the currently defined #to_time in core_ext which allows DateTimes outside the range of what can be created with Time (32-bit platform limit).
  • remove_method Date#xmlschema if Ruby 1.9 since it doesn't have the Time component. This is needed for XMLSchema as far as I can tell.

Attachments

date_time_xmlschema_fixes_1.9.diff (3.5 kB) - added by chuyeow on 12/11/07 11:27:18.

Change History

12/11/07 11:27:18 changed by chuyeow

  • attachment date_time_xmlschema_fixes_1.9.diff added.

12/15/07 02:34:41 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.