Storable sanification
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSourceHandle.pm
index 4a402e9..d7d0190 100644 (file)
@@ -78,8 +78,9 @@ sub STORABLE_freeze {
 
     my $to_serialize = { %$self };
 
-    my $class = $self->schema->class($self->source_moniker);
-    $to_serialize->{schema} = $class;
+    delete $to_serialize->{schema};
+    $to_serialize->{_frozen_from_class} = $self->schema->class($self->source_moniker);
+
     return (Storable::freeze($to_serialize));
 }
 
@@ -93,10 +94,10 @@ C<< $schema->thaw($ice) >> which handles this for you.
 
 
 sub STORABLE_thaw {
-    my ($self, $cloning,$ice) = @_;
+    my ($self, $cloning, $ice) = @_;
     %$self = %{ Storable::thaw($ice) };
 
-    my $class = delete $self->{schema};
+    my $class = delete $self->{_frozen_from_class};
     if( $thaw_schema ) {
         $self->{schema} = $thaw_schema;
     }