[Bast-commits] r3788 -
DBIx-Class/0.08/branches/jdbicompat/lib/DBIx/Class/JDBICompat
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Wed Sep 26 03:45:36 GMT 2007
Author: matthewt
Date: 2007-09-26 03:45:35 +0100 (Wed, 26 Sep 2007)
New Revision: 3788
Modified:
DBIx-Class/0.08/branches/jdbicompat/lib/DBIx/Class/JDBICompat/Record.pm
Log:
couple tweaks towards result_source usage in Handle.pm
Modified: DBIx-Class/0.08/branches/jdbicompat/lib/DBIx/Class/JDBICompat/Record.pm
===================================================================
--- DBIx-Class/0.08/branches/jdbicompat/lib/DBIx/Class/JDBICompat/Record.pm 2007-09-26 02:44:51 UTC (rev 3787)
+++ DBIx-Class/0.08/branches/jdbicompat/lib/DBIx/Class/JDBICompat/Record.pm 2007-09-26 02:45:35 UTC (rev 3788)
@@ -125,7 +125,7 @@
=cut
sub id {
- my $pkey = $_[0]->_primary_key();
+ my $pkey = ($_[0]->RESULT_SOURCE->primary_columns)[0];
my $ret = $_[0]->{'values'}->{$pkey};
return $ret;
}
@@ -203,7 +203,13 @@
my @pri = @{$self->_primary_keys};
- $source->add_columns(@pri);
+ $source->add_columns(map {
+ ($_ => {
+ data_type => 'integer',
+ is_nullable => 0,
+ is_auto_increment => 1
+ })
+ } @pri);
$source->set_primary_key(@pri);
foreach my $column_name ( @pri ) {
More information about the Bast-commits
mailing list