[Dbix-class] A timestamp field is null when a record is created
Robert Rothenberg
robrwo at gmail.com
Tue Oct 30 12:47:47 GMT 2012
I have a Postgres table with a timestamp field that defaults to the current
time:
CREATE TABLE "notes" (
"id" SERIAL PRIMARY KEY NOT NULL,
"note" TEXT,
"created" TIMESTAMP NOT NULL DEFAULT current_timestamp
);
In a Catalyst application, I create the a record like so:
my $rec = { note => $note };
my $obj = $c->model($NOTE_TABLE)->create($rec);
The record is created, and the "created" field in the database is populated
with the current time. But $obj->created is undefined.
I have tried it with DBIC 0.08203 and the problem still occurs.
Any ideas what's causing this? Is it a but with DBIC or the
InflateColumn::DateTime, or something else?
More information about the DBIx-Class
mailing list