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)};
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