From: Jess Robinson <j.robinson@shadowcat.co.uk>
Date: Thu, 24 May 2012 15:50:31 +0000 (+0000)
Subject: Trying out public attr and searching - not very successfully
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3724dfa73f22f321137560dba6d11cd65aace13b;p=scpubgit%2Fstemmatology.git

Trying out public attr and searching - not very successfully
---

diff --git a/lib/Text/Tradition.pm b/lib/Text/Tradition.pm
index e454722..e135da9 100644
--- a/lib/Text/Tradition.pm
+++ b/lib/Text/Tradition.pm
@@ -62,7 +62,14 @@ has 'user' => (
     predicate => 'has_user',
     clearer => 'clear_user',
     );
-  
+
+has 'public' => (
+    is => 'rw',
+    isa => 'Bool',
+    required => 0,
+    default => sub { 0; },
+    );
+
 # Create the witness before trying to add it
 around 'add_witness' => sub {
     my $orig = shift;
diff --git a/lib/Text/Tradition/Directory.pm b/lib/Text/Tradition/Directory.pm
index 743ab6c..11d82a3 100644
--- a/lib/Text/Tradition/Directory.pm
+++ b/lib/Text/Tradition/Directory.pm
@@ -293,7 +293,8 @@ sub user_traditionlist {
     
     ## Search for all traditions which allow public viewing
     ## When they exist!
-    # $self->search({ public => 1 });
+## This needs to be more sophisticated, probably needs Search::GIN
+#    my $list = $self->search({ public => 1 });
     
     ## For now, just fetch all
     ## (could use all_objects or grep down there?)