aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Field.pm
diff options
context:
space:
mode:
authormatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-24 07:41:36 +0000
committermatthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-01-24 07:41:36 +0000
commit80bb08dc211c0a0e1d3632f922fed32f02a37d23 (patch)
tree67c838b40df95b70726cdca42a84e5876da04670 /lib/Reaction/UI/ViewPort/Field.pm
parentaac30a0d4e5360ff525f3616b5afab642d4f5316 (diff)
downloadreaction-80bb08dc211c0a0e1d3632f922fed32f02a37d23.tar.gz
reaction-80bb08dc211c0a0e1d3632f922fed32f02a37d23.zip
more robust 'can we ask for a value' handling - need to check default as well as builder
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Field.pm')
-rw-r--r--lib/Reaction/UI/ViewPort/Field.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Reaction/UI/ViewPort/Field.pm b/lib/Reaction/UI/ViewPort/Field.pm
index 0da4838..b6fdf25 100644
--- a/lib/Reaction/UI/ViewPort/Field.pm
+++ b/lib/Reaction/UI/ViewPort/Field.pm
@@ -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;