From: Matt S Trout <mst@shadowcat.co.uk>
Date: Sat, 7 Jan 2006 21:47:24 +0000 (+0000)
Subject: Changed ->discard_changes to use ->primary_columns
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=741d6d0ecddc46df590f700f5270d1e287d4ab2b;p=dbsrgits%2FDBIx-Class-Historic.git

Changed ->discard_changes to use ->primary_columns
---

diff --git a/lib/DBIx/Class/PK.pm b/lib/DBIx/Class/PK.pm
index 4d46421..f156b59 100644
--- a/lib/DBIx/Class/PK.pm
+++ b/lib/DBIx/Class/PK.pm
@@ -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;