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

sartak at bestpractical.com sartak at bestpractical.com
Sat May 17 09:25:06 EDT 2008


Author: sartak
Date: Sat May 17 09:25:05 2008
New Revision: 12498

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

Log:
 r56252 at onn:  sartak | 2008-05-17 09:25:01 -0400
 Run find_or_create_luid right after uuid is set, always


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 09:25:05 2008
@@ -35,8 +35,12 @@
 );
 
 has uuid => (
-    is  => 'rw',
-    isa => 'Str',
+    is      => 'rw',
+    isa     => 'Str',
+    trigger => sub {
+        my $self = shift;
+        $self->find_or_create_luid;
+    },
 );
 
 has luid => (
@@ -145,7 +149,6 @@
     $self->validate_props( $args{'props'} ) or return undef;
 
     $self->uuid($uuid);
-    $self->find_or_create_luid();
 
     $self->handle->create_record(
         props => $args{'props'},
@@ -187,7 +190,6 @@
         $self->uuid( $self->handle->find_uuid_by_luid( luid => $args{luid} ) );
     } else {
         $self->uuid( $args{uuid} );
-        $self->find_or_create_luid();
     }
 
     return $self->handle->record_exists(



More information about the Bps-public-commit mailing list