do not include .git directory
[catagits/Reaction.git] / lib / Reaction / UI / ViewPort / Field / RelatedObject.pm
CommitLineData
ddccc6a2 1package Reaction::UI::ViewPort::Field::RelatedObject;
7adfd53f 2
3use Reaction::Class;
4use Scalar::Util 'blessed';
7b5e71ad 5use MooseX::Types::Moose qw/Str/;
7adfd53f 6
81393881 7use namespace::clean -except => [ qw(meta) ];
8extends 'Reaction::UI::ViewPort::Field';
7adfd53f 9
81393881 10has value_map_method => (
7b5e71ad 11 isa => Str, is => 'ro', required => 1, default => sub { 'display_name' },
81393881 12);
13
14around _value_string_from_value => sub {
15 my $orig = shift;
16 my $self = shift;
17 my $meth = $self->value_map_method;
18 return $self->$orig(@_)->$meth;
7adfd53f 19};
20
81393881 21__PACKAGE__->meta->make_immutable;
22
23
7adfd53f 241;