extends 'DBIx::Class::ResultSet::WithMetaData;
method with_substr () {
- $self->build_metadata( modifier => sub () {
- my $row = shift;
- $row->{substr} = substr($row->{name}, 0, 3);
- return $row;
- });
- return $self;
+ return $self->_with_meta_key(
+ substr => sub {
+ return substr(shift->{name}, 0, 3);
+ }
+ );
}
...