Revision history for DBIx::Class
+ - weaken result_source in all resultsets
0.05999_03 2006-03-14 01:58:10
- has_many prefetch fixes
fallback => 1;
use Data::Page;
use Storable;
+use Scalar::Util qw/weaken/;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/AccessorGroup/);
return $class->new_result(@_) if ref $class;
my ($source, $attrs) = @_;
- #use Data::Dumper; warn Dumper($attrs);
+ weaken $source;
$attrs = Storable::dclone($attrs || {}); # { %{ $attrs || {} } };
+ #use Data::Dumper; warn Dumper($attrs);
my $alias = ($attrs->{alias} ||= 'me');
$attrs->{columns} ||= delete $attrs->{cols} if $attrs->{cols};
use DBIx::Class::ResultSet;
use Carp::Clan qw/^DBIx::Class/;
-
use Storable;
-use Scalar::Util qw/weaken/;
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/AccessorGroup/);
my $self = shift;
$self->throw_exception('resultset does not take any arguments. If you want another resultset, call it on the schema instead.') if scalar @_;
return $self->{_resultset} if ref $self->{_resultset} eq $self->resultset_class;
- return $self->{_resultset} = do {
- my $rs = $self->resultset_class->new($self, $self->{resultset_attributes});
- weaken $rs->result_source;
- $rs;
- };
+ return $self->{_resultset} = $self->resultset_class->new($self, $self->{resultset_attributes});
}
=head2 throw_exception