diff options
author | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-01-24 07:41:36 +0000 |
---|---|---|
committer | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-01-24 07:41:36 +0000 |
commit | 80bb08dc211c0a0e1d3632f922fed32f02a37d23 (patch) | |
tree | 67c838b40df95b70726cdca42a84e5876da04670 /lib/Reaction/UI/ViewPort/Field.pm | |
parent | aac30a0d4e5360ff525f3616b5afab642d4f5316 (diff) | |
download | reaction-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.pm | 5 |
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; |