package DBICTest::Schema::ResultSet::Artist;

use Moose;
use Method::Signatures::Simple;
extends 'DBICTest::Schema::ResultSet';

method with_substr () {
  $self->build_metadata( 
    modifier => sub () {
      my $row = shift;
      my $substr = substr($row->{name}, 0, 3);
      $row->{substr} = $substr;
      return $row;
    }
  );
  return $self;
}

method with_substr_old () {
  foreach my $row ($self->all) {
    my $substr = substr($row->name, 0, 3);
    $self->add_row_info(row => $row, info => { substr => $substr });
  }
  return $self;
}

1;
