From: David Kamholz Date: Fri, 3 Feb 2006 20:00:58 +0000 (+0000) Subject: - fix bug in ResultSetManager when a class has no subs with attrs X-Git-Tag: v0.05005~53 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49354ee30ddd401e34070d845495aee220bd6574;p=dbsrgits%2FDBIx-Class.git - fix bug in ResultSetManager when a class has no subs with attrs - attempt to sanitize Serialize --- diff --git a/lib/DBIx/Class/ResultSetManager.pm b/lib/DBIx/Class/ResultSetManager.pm index 8bfe4ed..258cc7c 100644 --- a/lib/DBIx/Class/ResultSetManager.pm +++ b/lib/DBIx/Class/ResultSetManager.pm @@ -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)}; diff --git a/lib/DBIx/Class/Serialize.pm b/lib/DBIx/Class/Serialize.pm index 7fb4147..b032ad9 100644 --- a/lib/DBIx/Class/Serialize.pm +++ b/lib/DBIx/Class/Serialize.pm @@ -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