carp "Column '$col' of '$class/$id' was fetched as a hash"
if $ENV{DBIC_CDBICOMPAT_HASH_WARN};
- return $obj->get_column($col);
+ return $obj->column_info($col)->{_inflate_info}
+ ? $obj->get_inflated_column($col)
+ : $obj->get_column($col);
}
sub STORE {
carp "Column '$col' of '$class/$id' was stored as a hash"
if $ENV{DBIC_CDBICOMPAT_HASH_WARN};
- $obj->set_column($col => shift);
+ return $obj->column_info($col)->{_inflate_info}
+ ? $obj->set_inflated_column($col => shift)
+ : $obj->set_column($col => shift);
}
1;
ok !eval { $actor->film };
is $actor->{film}->id, $waves->id,
'hash access still works despite lack of accessor';
+}
+
+
+# Emulate that Class::DBI inflates immediately
+{
+ require_ok 'MyFoo';
+
+ my $foo = MyFoo->insert({
+ name => 'Whatever',
+ tdate => '1949-02-01',
+ });
+ isa_ok $foo, 'MyFoo';
+
+ isa_ok $foo->{tdate}, 'Date::Simple';
+ is $foo->{tdate}->year, 1949;
}
\ No newline at end of file