deprecated add_row_info and added replacement method build_metadata
[dbsrgits/DBIx-Class-ResultSet-WithMetaData.git] / t / lib / DBICTest / Schema / ResultSet / Artist.pm
CommitLineData
b51d39c8 1package DBICTest::Schema::ResultSet::Artist;
2
3use Moose;
79b18b81 4use Method::Signatures::Simple;
b51d39c8 5extends 'DBICTest::Schema::ResultSet';
6
46845551 7method with_substr () {
f1690863 8 $self->build_metadata(
9 modifier => sub () {
10 my $row = shift;
11 my $substr = substr($row->{name}, 0, 3);
12 $row->{substr} = $substr;
13 return $row;
14 }
15 );
16 return $self;
17}
18
19method with_substr_old () {
20 foreach my $row ($self->all) {
21 my $substr = substr($row->name, 0, 3);
22 $self->add_row_info(row => $row, info => { substr => $substr });
23 }
24 return $self;
46845551 25}
26
b51d39c8 271;