Changed ->discard_changes to use ->primary_columns
Matt S Trout [Sat, 7 Jan 2006 21:47:24 +0000 (21:47 +0000)]
lib/DBIx/Class/PK.pm

index 4d46421..f156b59 100644 (file)
@@ -96,7 +96,7 @@ sub discard_changes {
   my ($self) = @_;
   delete $self->{_dirty_columns};
   return unless $self->in_storage; # Don't reload if we aren't real!
-  my ($reload) = $self->find($self->id);
+  my ($reload) = $self->find(map { $self->$_ } $self->primary_columns);
   unless ($reload) { # If we got deleted in the mean-time
     $self->in_storage(0);
     return $self;