From: Matt S Trout Date: Thu, 26 Jan 2006 20:52:21 +0000 (+0000) Subject: Added copying of refs durings ResultSource->new X-Git-Tag: v0.05005~101 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6da5894c37cdc588cbae37ab989166ff5fd248eb;p=dbsrgits%2FDBIx-Class.git Added copying of refs durings ResultSource->new --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 789aeda..2e5a84c 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -7,6 +7,8 @@ use DBIx::Class::ResultSet; use Carp qw/croak/; +use Storable; + use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/AccessorGroup/); @@ -33,9 +35,9 @@ sub new { $class = ref $class if ref $class; my $new = bless({ %{$attrs || {}} }, $class); $new->{resultset_class} ||= 'DBIx::Class::ResultSet'; - $new->{_ordered_columns} ||= []; - $new->{_columns} ||= {}; - $new->{_relationships} ||= {}; + $new->{_ordered_columns} = [ @{$new->{_ordered_columns}||[]}]; + $new->{_columns} = { %{$new->{_columns}||{}} }; + $new->{_relationships} = { %{$new->{_relationships}||{}} }; $new->{name} ||= "!!NAME NOT SET!!"; return $new; }