X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRelationship.pm;h=14741b0ee30ab594d72ccd4d9ea7f5037d978df2;hb=656796f2088da66cc80f4eb127c39c923ef3c1dd;hp=569de9bced44a871d8e7ebb31e809bbdd25b1afc;hpb=fcbc5f294ee9df62da9d6123c1cffda1f0368aa8;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Relationship.pm b/lib/DBIx/Class/Relationship.pm index 569de9b..14741b0 100644 --- a/lib/DBIx/Class/Relationship.pm +++ b/lib/DBIx/Class/Relationship.pm @@ -104,18 +104,18 @@ sub _cond_value { sub search_related { my $self = shift; - $self->_from_sql_related('retrieve', @_); + return $self->_literal_related('search', @_); } sub count_related { my $self = shift; - $self->_from_sql_related('count', @_); + return $self->_literal_related('count', @_); } -sub _from_sql_related { +sub _literal_related { my $self = shift; my $op = shift; - my $meth = "${op}_from_sql"; + my $meth = "${op}_literal"; my $rel = shift; my $attrs = { }; if (@_ > 1 && ref $_[$#_] eq 'HASH') { @@ -134,6 +134,7 @@ sub _from_sql_related { # to merge into the AST really? my ($cond) = $self->_cond_resolve($rel_obj->{cond}, $attrs); $cond = "${s_cond} AND ${cond}" if $s_cond; + #warn $rel_obj->{class}." $meth $cond ".join(', ', @{$attrs->{bind}}); return $rel_obj->{class}->$meth($cond, @{$attrs->{bind} || []}, $attrs); }