Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Updating Date field recasts value as Time instead of Date

#438

After upgrading to 2.1 I noticed some odd behavior with a date type attribute on one of my models. After some investigation I found that after doing an update_attributes or update_attribute affecting the date field, I got a Time type value back.

irb(main):002:0> f.charge_start_date.class

=> Date

irb(main):003:0> f.update_attribute(:charge_start_date, Date.tomorrow)

=> true

irb(main):004:0> f.charge_start_date.class

=> Time

Reported by Mike Vincent · June 17th, 2008 @ 05:18 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Mike Vincent
    Mike Vincent

    Sorry, using native mysql driver, mysql 5.0.51a.

    June 17th, 2008 @ 05:29 PM

  2. Mike Vincent
    Mike Vincent

    Never mind, it must be something in my app. I don't know what yet, but I tried to reproduce it on a fresh rails app and can not.

    June 18th, 2008 @ 04:14 AM

  3. Geoff Buesing
    Geoff Buesing
    • State changed from new to invalid
    • Milestone cleared.

    June 18th, 2008 @ 05:55 PM