special exists event, force_events
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / RelatedObject.pm
1 package Reaction::UI::ViewPort::Field::RelatedObject;
2
3 use Reaction::Class;
4 use Scalar::Util 'blessed';
5
6 class RelatedObject is 'Reaction::UI::ViewPort::Field', which {
7
8   has value_map_method => (
9     isa => 'Str', is => 'ro', required => 1, default => sub { 'display_name' },
10   );
11
12   around _value_string_from_value => sub {
13     my $orig = shift;
14     my $self = shift;
15     my $meth = $self->value_map_method;
16     return $self->$orig(@_)->$meth;
17   };
18
19 };
20
21 1;