[Bps-public-commit] r12478 - in Prophet/branches/moose: .

sartak at bestpractical.com sartak at bestpractical.com
Sat May 17 08:10:53 EDT 2008


Author: sartak
Date: Sat May 17 08:10:53 2008
New Revision: 12478

Modified:
   Prophet/branches/moose/   (props changed)
   Prophet/branches/moose/lib/Prophet/Record.pm

Log:
 r56224 at onn:  sartak | 2008-05-17 08:08:52 -0400
 Avoid infinite recursion in the absence of a type. I think.


Modified: Prophet/branches/moose/lib/Prophet/Record.pm
==============================================================================
--- Prophet/branches/moose/lib/Prophet/Record.pm	(original)
+++ Prophet/branches/moose/lib/Prophet/Record.pm	Sat May 17 08:10:53 2008
@@ -24,10 +24,11 @@
 );
 
 has type => (
-    is       => 'rw',
-    isa      => 'Str',
-    required => 1,
-    default  => sub {
+    is        => 'rw',
+    isa       => 'Str',
+    required  => 1,
+    predicate => 'has_type',
+    default   => sub {
         my $self = shift;
         $self->record_type;
     },
@@ -56,7 +57,7 @@
 
 my $UUIDGEN = Data::UUID->new();
 
-sub record_type { $_[0]->type }
+sub record_type { $_[0]->has_type ? $_[0]->type : undef }
 
 =head1 METHODS
 



More information about the Bps-public-commit mailing list