10 DBICTest::CD->inflate_column( 'year',
11 { inflate => sub { DateTime->new( year => shift ) },
12 deflate => sub { shift->year } }
16 my $cd = DBICTest::CD->retrieve(3);
18 is( ref($cd->year), 'DateTime', 'year is a DateTime, ok' );
20 is( $cd->year->month, 1, 'inflated month ok' );
23 my $now = DateTime->now;
27 ($cd) = DBICTest::CD->search( year => $now->year );
28 is( $cd->year->year, $now->year, 'deflate ok' );