some syntactic sugar for relationship filters
[scpubgit/stemmatology.git] / lib / Text / Tradition / Collation / RelationshipStore.pm
index aeb8b7f..0ee51ab 100644 (file)
@@ -717,6 +717,9 @@ sub related_readings {
                # Backwards compat
                if( $filter eq 'colocated' ) {
                        $filter = sub { $_[0]->colocated };
+               } elsif( !ref( $filter ) ) {
+                       my $type = $filter;
+                       $filter = sub { $_[0]->type eq $type };
                }
                my %found = ( $reading => 1 );
                my $check = [ $reading ];