This project is archived and is in readonly mode.
Regression in date_select between 2.1.1 and 2.2 RC1
-
DHH
- Milestone cleared.
-
Bernardo Padua
- Tag changed from 2.2.rc1, actionview, date_helper to 2.2.rc1, actionview, date_helper, patch
This bug occurs whenever trying to use the +date_select+ and +datetime_select+ helpers with a date / datetime attribute that has a nil value (eg.: it wasn't set yet), and you configure the helper to discard the day.
@@@ Ruby <%= form.date_select 'end_date',
:discard_day => true, :include_blank => true %>This simple patch fixes it. It includes the tests written by Tor Erik, with a minor modification to make they pass as expected. It breaks current apps and is hard to debug so I think it should be applied ASAP, before the rails 2.2 release. -
Bernardo Padua
Sorry for the ugly formatting, I don't think code highlighting worked very well.
-
Repository
- State changed from new to committed
(from [b2cd318c2e3f4d19813a5c62903319a6683aa561]) Fix regression bug that made date_select and datetime_select raise a Null Pointer Exception when a nil date/datetime was passed and only month and year were displayed [#1289 state:committed]
Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co...
