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

Ticket #6363 (new defect)

Opened 2 years ago

Last modified 1 year ago

[PATCH] Fix Date.to_formatted_s so that changing the :default will not affect all printed dates

Reported by: olbrich Assigned to: David
Priority: normal Milestone: 2.x
Component: ActiveSupport Version: edge
Severity: normal Keywords: date tiny
Cc:

Description

Changing the :default date format causes problem with some database adapters (MySQL, in particular). Further discussion has suggested that it's just a bad idea to change the default format. This patch removes that functionality. If you change the :default date format, nothing will happen unless you specifically request output in that format (i.e., Date.today.to_s(:default) ).

Attachments

disable_default_date_format.diff (1.4 kB) - added by olbrich on 10/09/06 03:05:50.
patch to remove date default formatting option
disable_default_date_format_rev2.diff (1.5 kB) - added by josh on 02/23/07 21:32:41.
Updated to patch cleanly into r6216.
disable_default_date_format.2.diff (1.5 kB) - added by mpalmer on 07/23/07 00:24:07.

Change History

10/09/06 03:05:50 changed by olbrich

  • attachment disable_default_date_format.diff added.

patch to remove date default formatting option

(in reply to: ↑ description ) 10/09/06 03:08:00 changed by olbrich

related to Ticket #6019

02/23/07 21:32:41 changed by josh

  • attachment disable_default_date_format_rev2.diff added.

Updated to patch cleanly into r6216.

02/23/07 21:33:26 changed by josh

  • keywords changed from date to date verified tiny.
  • version changed from 1.1.6 to edge.

07/23/07 00:24:07 changed by mpalmer

  • attachment disable_default_date_format.2.diff added.

07/23/07 00:26:12 changed by mpalmer

  • keywords changed from date verified tiny to date tiny.

This patch didn't apply cleanly to trunk any more, so I rebased it against current edge. I'm not going to rate this patch myself, though, as I'm not familiar enough with the issues (including those raised by the related ticket #6019) to be able to say whether the patch is a net win or not. At the very least, though, the tests exercise the live code changes appropriately, and the patch now applies cleanly, at least.