From: Dagfinn Ilmari Mannsåker Date: Tue, 4 Sep 2007 16:44:41 +0000 (+0000) Subject: Fix return value for DBIC::ResultSource::Table->table($table) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ade8df5b7f265b5de75c6215914adf0627da5163;p=dbsrgits%2FDBIx-Class-Historic.git Fix return value for DBIC::ResultSource::Table->table($table) --- diff --git a/lib/DBIx/Class/ResultSourceProxy/Table.pm b/lib/DBIx/Class/ResultSourceProxy/Table.pm index ce78cb8..1b43c08 100644 --- a/lib/DBIx/Class/ResultSourceProxy/Table.pm +++ b/lib/DBIx/Class/ResultSourceProxy/Table.pm @@ -63,6 +63,7 @@ sub table { $class =~ m/([^:]+)$/; $class->schema_instance->register_class($class, $class); } + return $class->result_source_instance->name; } =head2 has_column diff --git a/t/60core.t b/t/60core.t index 2f3339e..456dc7b 100644 --- a/t/60core.t +++ b/t/60core.t @@ -7,7 +7,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 77; +plan tests => 78; eval { require DateTime::Format::MySQL }; my $NO_DTFM = $@ ? 1 : 0; @@ -337,3 +337,10 @@ SKIP: { is($edata{'created_on'}, $event->created_on, 'got created date'); } +# test resultsource->table return value when setting +{ + my $class = $schema->class('Event'); + diag $class; + my $table = $class->table($class->table); + is($table, $class->table, '->table($table) returns $table'); +}