fix from attr issue
David Kamholz [Wed, 12 Jul 2006 18:55:35 +0000 (18:55 +0000)]
lib/DBIx/Class/ResultSet.pm

index 9b40f03..e8b36cb 100644 (file)
@@ -1505,9 +1505,11 @@ sub _resolved_attrs {
       );
     }
 
-    push(@{$attrs->{from}},
-      $source->resolve_join($join, $alias, { %{$attrs->{seen_join}||{}} })
-    );
+    $attrs->{from} =   # have to copy here to avoid corrupting the original
+      [
+        @{$attrs->{from}}, 
+        $source->resolve_join($join, $alias, { %{$attrs->{seen_join}||{}} })
+      ];
   }
 
   $attrs->{group_by} ||= $attrs->{select} if delete $attrs->{distinct};