Turned out to be much trickier
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Storage / DBIHacks.pm
index f549204..43faccf 100644 (file)
@@ -43,7 +43,6 @@ sub _prune_unused_joins {
   return \@newfrom;
 }
 
-
 #
 # This is the code producing joined subqueries like:
 # SELECT me.*, other.* FROM ( SELECT me.* FROM ... ) JOIN other ON ... 
@@ -255,7 +254,7 @@ sub _resolve_aliastypes_from_select_args {
   for my $type (keys %$aliases_by_type) {
     for my $alias (keys %{$aliases_by_type->{$type}}) {
       $aliases_by_type->{$type}{$_} = 1
-        for (@{ $alias_list->{$alias}{-join_path} || [] });
+        for (map { keys %$_ } @{ $alias_list->{$alias}{-join_path} || [] });
     }
   }
 
@@ -400,7 +399,7 @@ sub _straight_join_to_node {
   # anyway, and deep cloning is just too fucking expensive
   # So replace the first hashref in the node arrayref manually 
   my @new_from = ($from->[0]);
-  my $sw_idx = { map { $_ => 1 } @$switch_branch };
+  my $sw_idx = { map { values %$_ => 1 } @$switch_branch };
 
   for my $j (@{$from}[1 .. $#$from]) {
     my $jalias = $j->[0]{-alias};