From: D. Ilmari Mannsåker Date: Mon, 8 Jul 2013 12:09:30 +0000 (+0100) Subject: Fix "table" parameter in col_accessor_map callback (RT#84050) X-Git-Tag: 0.07036~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=04568a4e68f2276e4e8797a8fe162fe11dad4f8d;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Fix "table" parameter in col_accessor_map callback (RT#84050) Keep the old, erroneous "table_name" for backward compatibility. --- diff --git a/Changes b/Changes index c0b6fa4..b317e57 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for Perl extension DBIx::Class::Schema::Loader - Fix stray comma in Pg on_delete/on_update => CASCADE (RT#84706) - Fix MySQL enums with empty strings and leading/trailing quotes (RT#86091) + - Fix "table" parameter in col_accessor_map callback (RT#84050) 0.07035 2013-02-26 - Release 0.07034_01 with a stable version number. 0.07034 is diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 31221e6..a3c1f2a 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -2415,7 +2415,8 @@ sub _setup_src_meta { my $context = { table_class => $table_class, table_moniker => $table_moniker, - table_name => $table, + table_name => $table, # bugwards compatibility, RT#84050 + table => $table, full_table_name => $table->dbic_name, schema_class => $schema_class, column_info => $info, diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index 13c8002..8b174d0 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -113,7 +113,7 @@ sub run_tests { my $extra_count = $self->{extra}{count} || 0; - my $col_accessor_map_tests = 5; + my $col_accessor_map_tests = 6; my $num_rescans = 6; $num_rescans++ if $self->{vendor} eq 'mssql'; $num_rescans++ if $self->{vendor} eq 'Firebird'; @@ -2291,7 +2291,7 @@ sub test_col_accessor_map { 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 ); + for qw( table table_name table_class table_moniker schema_class ); return 'trivet'; } else {