warn "Skipping mapping $col to a hash key because it exists";
}
- next unless $self->can($col);
tie $self->{$col}, 'DBIx::Class::CDBICompat::Tied::ColumnValue',
$self, $col;
}
BEGIN {
eval "use DBIx::Class::CDBICompat;";
plan $@ ? (skip_all => "Class::Trigger and DBIx::ContextualFetch required: $@")
- : (tests=> 10);
+ : ('no_plan');
}
use lib 't/testlib';
is $waves->{rating}, "R";
}
-
\ No newline at end of file
+
+
+{
+ no warnings 'redefine';
+ no warnings 'once';
+ local *Actor::accessor_name_for = sub {
+ my($class, $col) = @_;
+ return "movie" if lc $col eq "film";
+ return $col;
+ };
+
+ require Actor;
+
+ my $actor = Actor->insert({
+ name => 'Emily Watson',
+ film => $waves,
+ });
+
+ ok !eval { $actor->film };
+ is $actor->{film}->id, $waves->id,
+ 'hash access still works despite lack of accessor';
+}
\ No newline at end of file