more robust 'can we ask for a value' handling - need to check default as well as...
matthewt [Thu, 24 Jan 2008 07:41:36 +0000 (07:41 +0000)]
lib/Reaction/UI/ViewPort/Field.pm

index 0da4838..b6fdf25 100644 (file)
@@ -30,7 +30,10 @@ class Field is 'Reaction::UI::ViewPort', which {
     my $predicate = $self->attribute->predicate;
 
     if (!$predicate || $self->model->$predicate
-        || $self->attribute->is_lazy_build) {
+        || ($self->attribute->is_lazy
+            && ($self->attribute->builder
+                || $self->attribute->default))
+      ) {
       return $self->model->$reader;
     }
     return $self->_empty_value;