diff options
author | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-01-23 03:54:44 +0000 |
---|---|---|
committer | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2008-01-23 03:54:44 +0000 |
commit | 398c8477239bc55bbef1d5337a76a8cc7b7bcfde (patch) | |
tree | 902a0eef3e7edfd0afe1044ce5b8c68c75553d9f /lib/Reaction/UI/ViewPort/Field.pm | |
parent | cf272446849d14dbd596b658243a41a5abb49ca6 (diff) | |
download | reaction-398c8477239bc55bbef1d5337a76a8cc7b7bcfde.tar.gz reaction-398c8477239bc55bbef1d5337a76a8cc7b7bcfde.zip |
make default handling respect predicate when attr is not lazy build
Diffstat (limited to 'lib/Reaction/UI/ViewPort/Field.pm')
-rw-r--r-- | lib/Reaction/UI/ViewPort/Field.pm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Reaction/UI/ViewPort/Field.pm b/lib/Reaction/UI/ViewPort/Field.pm index c1c35c8..0da4838 100644 --- a/lib/Reaction/UI/ViewPort/Field.pm +++ b/lib/Reaction/UI/ViewPort/Field.pm @@ -28,13 +28,16 @@ class Field is 'Reaction::UI::ViewPort', which { my ($self) = @_; my $reader = $self->attribute->get_read_method; my $predicate = $self->attribute->predicate; - #this is bound to blow the fuck if !model->$predicate what to do? - return $self->model->$reader ; #if (!$predicate || $self->model->$predicate); - print STDERR "weird!\n"; - return; + if (!$predicate || $self->model->$predicate + || $self->attribute->is_lazy_build) { + return $self->model->$reader; + } + return $self->_empty_value; }; + implements _empty_value => as { '' }; + }; 1; |