Given a table such as this:
create table foo
(
id serial,
time timestamp default now()
);
The "time" field, if not explicitly assigned by the application, will get a value assigned by PostgreSQLAdapter#default_value -- it returns Time.now.to_s for such columns.
Unfortunately, in production mode this defaults-assignment logic seems to be invoked only once; thus from the application's perspective, all time unassigned fields will get the time at which the Rails processed started.
For many apps this is not a problem, but it *is* a problem if you depend on "created_at" being maintained automatically.
I started thinking I could patch this, but the problem seems pretty deeply rooted in how ActiveRecord handles default values. Column#default, after all, is expected to be a static value, not a function. Thus dynamic column-level defaults (ie., ones that invoke a database-side function) is generally not supported.
In fact, the logic in !PostgreSQLAdapter to support PostgreSQL's now() function is really a special-case kludge. So if I were to fix anything it would be to make PostgreSQLAdapter#default_value return nil for cases where the schema uses a function default. This lets the data flow through ActiveRecord correctly.