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

Ticket #2877 (closed defect: duplicate)

Opened 4 years ago

Last modified 4 years ago

[PATCH] Fix for #2873, "PostgreSQL time field with now() as default gets unchanging value"

Reported by: stephen_purcell@yahoo.com Assigned to: David
Priority: normal Milestone:
Component: ActiveRecord Version: 0.14.3
Severity: normal Keywords:
Cc:

Description

Patch against 0.14.3 is attached, and it works well for me. See #2873 for background.

Attachments

postgresql-time-defaults-broken.patch (0.8 kB) - added by stephen_purcell@yahoo.com on 11/15/05 14:17:10.

Change History

11/15/05 14:17:10 changed by stephen_purcell@yahoo.com

  • attachment postgresql-time-defaults-broken.patch added.

11/15/05 15:30:21 changed by bitsweat

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

This is part of a larger problem with the way defaults are interpreted. Giving nil for the default will cause regressions in many apps which expect to display the current time. The best solution for these apps is to use a before_save filter to set the default value to Time.now.

See #2257.

11/15/05 15:54:13 changed by stephen_purcell@yahoo.com

Okay, thanks for the cross reference Jeremy.