From: Luke Saunders Date: Thu, 20 May 2010 08:35:14 +0000 (+0100) Subject: fixed synopsis X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=50e9dd04209bfa8fb4ce6a4f8d10c315ba0a9dfd;p=dbsrgits%2FDBIx-Class-ResultSet-WithMetaData.git fixed synopsis --- diff --git a/lib/DBIx/Class/ResultSet/WithMetaData.pm b/lib/DBIx/Class/ResultSet/WithMetaData.pm index 15cc209..feff809 100644 --- a/lib/DBIx/Class/ResultSet/WithMetaData.pm +++ b/lib/DBIx/Class/ResultSet/WithMetaData.pm @@ -54,12 +54,11 @@ DBIx::Class::ResultSet::WithMetaData 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); + } + ); } ...