[Bast-commits] r4812 - DBIx-Class/0.08/trunk/lib/DBIx/Class

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Tue Sep 16 19:58:25 BST 2008


Author: matthewt
Date: 2008-09-16 19:58:25 +0100 (Tue, 16 Sep 2008)
New Revision: 4812

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
Log:
fixup get_from_storage and delete to use original ident

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm	2008-09-16 17:10:01 UTC (rev 4811)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Row.pm	2008-09-16 18:58:25 UTC (rev 4812)
@@ -378,7 +378,7 @@
   my $self = shift;
   if (ref $self) {
     $self->throw_exception( "Not in database" ) unless $self->in_storage;
-    my $ident_cond = $self->ident_condition;
+    my $ident_cond = $self->{_orig_ident} || $self->ident_condition;
     $self->throw_exception("Cannot safely delete a row in a PK-less table")
       if ! keys %$ident_cond;
     foreach my $column (keys %$ident_cond) {
@@ -836,14 +836,13 @@
 sub get_from_storage {
     my $self = shift @_;
     my $attrs = shift @_;
-    my @primary_columns = map { $self->$_ } $self->primary_columns;
     my $resultset = $self->result_source->resultset;
     
     if(defined $attrs) {
     	$resultset = $resultset->search(undef, $attrs);
     }
     
-    return $resultset->find(@primary_columns);	
+    return $resultset->find($self->{_orig_ident} || $self->ident_condition);
 }
 
 =head2 throw_exception




More information about the Bast-commits mailing list