From: David Kamholz Date: Thu, 26 Jan 2006 18:14:32 +0000 (+0000) Subject: fix ResultSourceProxy::Table for inherited classes (needs testing) X-Git-Tag: v0.05005~102 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a879106d5ffdd396b40152c2f8f462e93d2c3e4;p=dbsrgits%2FDBIx-Class.git fix ResultSourceProxy::Table for inherited classes (needs testing) --- diff --git a/lib/DBIx/Class/ResultSourceProxy/Table.pm b/lib/DBIx/Class/ResultSourceProxy/Table.pm index e8a2da0..4f23097 100644 --- a/lib/DBIx/Class/ResultSourceProxy/Table.pm +++ b/lib/DBIx/Class/ResultSourceProxy/Table.pm @@ -42,16 +42,11 @@ sub table { my ($class, $table) = @_; return $class->result_source_instance->name unless $table; unless (ref $table) { - $table = $class->table_class->new( - { + $table = $class->table_class->new({ + $class->can('result_source_instance') ? %{$class->result_source_instance} : (), name => $table, result_class => $class, - }); - if ($class->can('result_source_instance')) { - $table->{_columns} = { %{$class->result_source_instance->{_columns}||{}} }; - $table->{_ordered_columns} = - [ @{$class->result_source_instance->{_ordered_columns}||[]} ]; - } + }); } $class->mk_classdata('result_source_instance' => $table); if ($class->can('schema_instance')) {