has_a inflate issue

[prev] [thread] [next] [Date index for 2004/12/22]

From: diona
Subject: has_a inflate issue
Date: 18:30 on 22 Dec 2004
I normally lurk for a while but I've got an issue with a tight deadline. I have some code as follows:

## Time Objectification stuff. See Time::Piece & T:P:MySQL for usage
__PACKAGE__->has_a(
        created => 'Time::Piece',
        inflate => sub { Time::Piece->from_mysql_timestamp(shift) },
        deflate => 'mysql_timestamp',
);

__PACKAGE__->has_a(
        last_access     => 'Time::Piece',
        inflate         => sub { Time::Piece->from_mysql_timestamp(shift) },
        deflate         => 'mysql_timestamp',
);

I'm getting the error: 
[Wed Dec 22 13:02:08 2004] [error] Can't inflate created to Time::Piece via CODE(0x8803dac) using '2004-12-22 13:02:08' at /usr/local/share/perl/5.6.1/Class/Trigger.pm line 51

I've tracked this down and the code above is the only place I'm inflating 'created'. I can't figure out why the code is dying on this...

has_a inflate issue
diona 18:30 on 22 Dec 2004

Re: has_a inflate issue
Diona Kidd 19:26 on 22 Dec 2004

Re: has_a inflate issue
Tony Bowden 01:11 on 23 Dec 2004

Re: has_a inflate issue
Diona Kidd 05:20 on 23 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52