some syntactic sugar for relationship filters
Tara L Andrews [Wed, 11 Jul 2012 10:08:37 +0000 (12:08 +0200)]
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 ];