8 eval "use DBIx::Class::CDBICompat;";
9 plan $@ ? (skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@")
16 my $waves = Film->insert({
17 Title => "Breaking the Waves",
18 Director => 'Lars von Trier',
23 my $rating = $waves->{rating};
25 is $rating, "R", 'evaluation of column value is not deferred';
26 } qr{^Column 'rating' of 'Film/$waves' was fetched as a hash at \Q$0};
29 is $waves->{title}, $waves->Title, "columns can be accessed as hashes";
30 } qr{^Column 'title' of 'Film/$waves' was fetched as a hash at\b};
35 is $waves->{rating}, "G", "updating via the accessor updates the hash";
36 } qr{^Column 'rating' of 'Film/$waves' was fetched as a hash at\b};
40 $waves->{rating} = "PG";
41 } qr{^Column 'rating' of 'Film/$waves' was stored as a hash at\b};
44 my @films = Film->search( Rating => "PG", Title => "Breaking the Waves" );
45 is @films, 1, "column updated as hash was saved";