readded lazy checks to enable choose one defaults based on lazy_build
edenc [Fri, 31 Oct 2008 14:15:39 +0000 (14:15 +0000)]
lib/Reaction/UI/ViewPort/Field.pm

index 1555f99..27bbf58 100644 (file)
@@ -32,9 +32,13 @@ sub _model_has_value {
   my $predicate = $self->attribute->get_predicate_method;
 
   if (!$predicate || $self->model->$predicate
-      #|| ($self->attribute->is_lazy
-      #    && !$self->attribute->is_lazy_fail)
+      || ($self->attribute->is_lazy
+          && !$self->attribute->is_lazy_fail)
     ) {
+    # edenc -- uncommented the lazy checks above
+    # model->$predicate returns false if the value isn't set
+    # but has a lazy builder
+
     # either model attribute has a value now or can build it
     return 1;
   }