2.2 date_select bug patch review request

Hi all,

I have run into the following regression bug when upgrading my app to 2.2 and created a patch to fix it:

http://rails.lighthouseapp.com/projects/8994/tickets/1289-regression-in-date_select-between-211-and-22-rc1

It includes the tests written by the ticket author.

date_select and datetime_select helpers blow up (calling a method on nil) when you have a date/datetime attribute that is nil and you try to show it in a helper that hides the day selection and includes blank:

  <%= form.date_select 'end_date',     :discard_day => true,     :include_blank => true %>

Please give the patch some reviewing love and apply it ASAP, if possible. It is a stupid but hard to debug error that will give people lots of headaches.

Cheers,

Bernardo

Please give the patch some reviewing love and apply it ASAP, if possible. It is a stupid but hard to debug error that will give people lots of headaches.

Applied. Thanks for the fix.