[Dbix-class] multiple has_many rels in prefetch not supported
in 0.081?
Moritz Onken
onken at houseofdesign.de
Wed Aug 27 10:20:03 BST 2008
Forgot the DBIC patch
Index: /Users/mo/Documents/workspace/DBIx-Class/lib/DBIx/Class/
ResultSource.pm
===================================================================
--- /Users/mo/Documents/workspace/DBIx-Class/lib/DBIx/Class/
ResultSource.pm (revision 4784)
+++ /Users/mo/Documents/workspace/DBIx-Class/lib/DBIx/Class/
ResultSource.pm (working copy)
@@ -906,15 +906,15 @@
"Can't prefetch has_many ${pre} (join cond too complex)")
unless ref($rel_info->{cond}) eq 'HASH';
my $dots = @{[$as_prefix =~ m/\./g]} + 1; # +1 to match the ".$
{as_prefix}"
- if (my ($fail) = grep { @{[$_ =~ m/\./g]} == $dots }
- keys %{$collapse}) {
- my ($last) = ($fail =~ /([^\.]+)$/);
- $self->throw_exception(
- "Can't prefetch multiple has_many rels ${last} and ${pre}"
- .(length($as_prefix) ? "at the same level (${as_prefix})"
- : "at top level"
- ));
- }
+ # if (my ($fail) = grep { @{[$_ =~ m/\./g]} == $dots }
+ # keys %{$collapse}) {
+ # my ($last) = ($fail =~ /([^\.]+)$/);
+ # $self->throw_exception(
+ # "Can't prefetch multiple has_many rels ${last} and ${pre}"
+ # .(length($as_prefix) ? "at the same level (${as_prefix})"
+ # : "at top level"
+ # ));
+ # }
#my @col = map { (/^self\.(.+)$/ ? ("${as_prefix}.$1") : ()); }
# values %{$rel_info->{cond}};
$collapse->{".${as_prefix}${pre}"} = [ $rel_source-
>primary_columns ];
More information about the DBIx-Class
mailing list