[Bast-commits] r8501 - DBIx-Class/0.08/branches/chaining_fixes/lib/DBIx/Class

frew at dev.catalyst.perl.org frew at dev.catalyst.perl.org
Tue Feb 2 04:12:30 GMT 2010


Author: frew
Date: 2010-02-02 04:12:29 +0000 (Tue, 02 Feb 2010)
New Revision: 8501

Modified:
   DBIx-Class/0.08/branches/chaining_fixes/lib/DBIx/Class/ResultSet.pm
Log:
revert actual changes from yesterday as per ribasushis advice

Modified: DBIx-Class/0.08/branches/chaining_fixes/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/chaining_fixes/lib/DBIx/Class/ResultSet.pm	2010-02-01 22:42:14 UTC (rev 8500)
+++ DBIx-Class/0.08/branches/chaining_fixes/lib/DBIx/Class/ResultSet.pm	2010-02-02 04:12:29 UTC (rev 8501)
@@ -2710,10 +2710,11 @@
   return { %{$self->_resolved_attrs (@_)} };
 }
 
-sub _merge_attrs {
-  my $self  = shift;
-  my $attrs = shift;
+sub _resolved_attrs {
+  my $self = shift;
+  return $self->{_attrs} if $self->{_attrs};
 
+  my $attrs  = { %{ $self->{attrs} || {} } };
   my $source = $self->result_source;
   my $alias  = $attrs->{alias};
 
@@ -2766,13 +2767,13 @@
   if ( $attrs->{select} ) {
     $attrs->{select} =
         ( ref $attrs->{select} eq 'ARRAY' )
-      ? $attrs->{select}
+      ? [ @{ $attrs->{select} } ]
       : [ $attrs->{select} ];
     $attrs->{as} = (
       $attrs->{as}
       ? (
         ref $attrs->{as} eq 'ARRAY'
-        ? $attrs->{as}
+        ? [ @{ $attrs->{as} } ]
         : [ $attrs->{as} ]
         )
       : [ map { m/^\Q${alias}.\E(.+)$/ ? $1 : $_ } @{ $attrs->{select} } ]
@@ -2798,18 +2799,7 @@
     $adds = [$adds] unless ref $adds eq 'ARRAY';
     push @{ $attrs->{as} }, @$adds;
   }
-  return $attrs;
-}
 
-sub _resolved_attrs {
-  my $self = shift;
-  return $self->{_attrs} if $self->{_attrs};
-
-  my $attrs = $self->_merge_attrs({ %{ $self->{attrs} || {} } });
-  my $source = $self->result_source;
-  my $alias  = $attrs->{alias};
-
-
   $attrs->{from} ||= [ {
     -source_handle => $source->handle,
     -alias => $self->{attrs}{alias},




More information about the Bast-commits mailing list