- fix bug in ResultSetManager when a class has no subs with attrs
David Kamholz [Fri, 3 Feb 2006 20:00:58 +0000 (20:00 +0000)]
- attempt to sanitize Serialize

lib/DBIx/Class/ResultSetManager.pm
lib/DBIx/Class/Serialize.pm

index 8bfe4ed..258cc7c 100644 (file)
@@ -22,6 +22,8 @@ sub load_resultset_components {
 
 sub _register_attributes {
     my $self = shift;
+    return unless $self->can('_attr_cache');
+
     my $cache = $self->_attr_cache;
     foreach my $meth (@{Class::Inspector->methods($self) || []}) {
         my $attrs = $cache->{$self->can($meth)};
index 7fb4147..b032ad9 100644 (file)
@@ -14,9 +14,10 @@ sub STORABLE_thaw {
     my ($self,$cloning,$serialized) = @_;
     %$self = %{ thaw($serialized) };
     no strict 'refs';
-    my $class = ${(ref $self) . '::ISA'}[0];
-    my $schema = DB->schema;
-    $self->result_source($schema->source($class));
+    $self->result_source($self->result_source_instance);
+#    my $class = ${(ref $self) . '::ISA'}[0];
+#    my $schema = $self->result_source_instance->schema;
+#    $self->result_source($schema->source($class));
 }
 
 1;
\ No newline at end of file