skip_relationships
skip_load_external
moniker_map
- column_accessor_map
+ col_accessor_map
custom_column_info
inflect_singular
inflect_plural
stations_visited | StationVisited
routeChange | RouteChange
-=head2 column_accessor_map
+=head2 col_accessor_map
Same as moniker_map, but for column accessor names. If a coderef is
passed, the code is called with arguments of
sub new {
my ( $class, %args ) = @_;
+ if (exists $args{column_accessor_map}) {
+ $args{col_accessor_map} = delete $args{column_accessor_map};
+ }
+
my $self = { %args };
# don't lose undef options
}
}
-# use the same logic to run moniker_map, column_accessor_map, and
+# use the same logic to run moniker_map, col_accessor_map, and
# relationship_name_map
sub _run_user_map {
my ( $self, $map, $default_code, $ident, @extra ) = @_;
my ($self, $column_name, $column_context_info ) = @_;
my $accessor = $self->_run_user_map(
- $self->column_accessor_map,
+ $self->col_accessor_map,
sub { $self->_default_column_accessor_name( shift ) },
$column_name,
$column_context_info,
my $extra_count = $self->{extra}{count} || 0;
- my $column_accessor_map_tests = 5;
+ my $col_accessor_map_tests = 5;
my $num_rescans = 5;
$num_rescans-- if $self->{vendor} =~ /^(?:sybase|mysql)\z/i;
$num_rescans++ if $self->{vendor} eq 'mssql';
$num_rescans++ if $self->{vendor} eq 'Firebird';
plan tests => @connect_info *
- (188 + $num_rescans * $column_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
+ (188 + $num_rescans * $col_accessor_map_tests + $extra_count + ($self->{data_type_tests}{test_count} || 0));
foreach my $info_idx (0..$#connect_info) {
my $info = $connect_info[$info_idx];
use_moose => $ENV{SCHEMA_LOADER_TESTS_USE_MOOSE},
col_collision_map => { '^(can)\z' => 'caught_collision_%s' },
rel_collision_map => { '^(set_primary_key)\z' => 'caught_rel_collision_%s' },
- column_accessor_map => \&test_column_accessor_map,
+ col_accessor_map => \&test_col_accessor_map,
%{ $self->{loader_options} || {} },
);
isa_ok( $rs_rel4->first, $class4);
is( $class4->column_info('crumb_crisp_coating')->{accessor}, 'trivet',
- 'column_accessor_map is being run' );
+ 'col_accessor_map is being run' );
# check rel naming with prepositions
ok ($rsobj4->result_source->has_relationship('loader_test5s_to'),
return $conn->rescan;
}
-sub test_column_accessor_map {
+sub test_col_accessor_map {
my ( $column_name, $default_name, $context ) = @_;
if( lc($column_name) eq 'crumb_crisp_coating' ) {
- is( $default_name, 'crumb_crisp_coating', 'column_accessor_map was passed the default name' );
- ok( $context->{$_}, "column_accessor_map func was passed the $_" )
+ is( $default_name, 'crumb_crisp_coating', 'col_accessor_map was passed the default name' );
+ ok( $context->{$_}, "col_accessor_map func was passed the $_" )
for qw( table_name table_class table_moniker schema_class );
return 'trivet';