Commit | Line | Data |
b51d39c8 |
1 | package DBICTest::Schema::ResultSet::Artist; |
2 | |
3 | use Moose; |
79b18b81 |
4 | use Method::Signatures::Simple; |
b51d39c8 |
5 | extends 'DBICTest::Schema::ResultSet'; |
6 | |
46845551 |
7 | method 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 | |
19 | method 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 |
27 | 1; |