X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FTree%2FAdjacencyList.pm;h=e14875fe3e53a3cca2e11ac000ca6a75184ccae1;hb=ab184e4a4303cde87f3f585ec422f99898a915b4;hp=e668a383cb896dfbe786727e4ea07d1a0dca8f58;hpb=2bd95b57b6661b3a4e4fcb9bc519b27022c3590e;p=dbsrgits%2FDBIx-Class-Tree.git diff --git a/lib/DBIx/Class/Tree/AdjacencyList.pm b/lib/DBIx/Class/Tree/AdjacencyList.pm index e668a38..e14875f 100644 --- a/lib/DBIx/Class/Tree/AdjacencyList.pm +++ b/lib/DBIx/Class/Tree/AdjacencyList.pm @@ -309,10 +309,7 @@ Returns 1 if the object has no children, and 0 otherwise. sub is_leaf { my( $self ) = @_; - my $has_child = $self->result_source->resultset->search( - { $self->_parent_column => $self->id() }, - { limit => 1 } - )->count(); + my $has_child = $self->children_rs->count(); return $has_child ? 0 : 1; }