From: luke Date: Tue, 26 May 2009 13:55:38 +0000 (+0000) Subject: tests pass + cleanup X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b599f0b65b576d917fdc474801841f72a678be4;hp=46845551adc234ce4437faf1e94fb477f56863ce;p=dbsrgits%2FDBIx-Class-ResultSet-WithMetaData.git tests pass + cleanup --- diff --git a/Makefile.PL b/Makefile.PL index b5dca3e..493b48f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -7,7 +7,7 @@ all_from 'lib/DBIx/Class/ResultSet/WithMetaData.pm'; requires 'DBIx::Class' => 0.08; requires 'MooseX::Method::Signatures' => 0.16; requires 'Data::Alias'; -requires 'DBIx::Class::ResultClass::HashRefInflator; +requires 'DBIx::Class::ResultClass::HashRefInflator'; build_requires 'Test::More' => 0.7; diff --git a/lib/DBIx/Class/ResultSet/WithMetaData.pm b/lib/DBIx/Class/ResultSet/WithMetaData.pm index b3004db..9cb3c86 100644 --- a/lib/DBIx/Class/ResultSet/WithMetaData.pm +++ b/lib/DBIx/Class/ResultSet/WithMetaData.pm @@ -86,35 +86,8 @@ method limit (Int :$count) { return $self->search({}, { rows => $count }); } -method with_token { - foreach my $row ($self->all) { - my $token = $self->tokenify($row->get_column($self->token_col)); - $self->add_row_info(id => $row->id, info => { join('_', 'token', $self->token_col) => $token }); - } - - return $self; -} - method _mk_id (HashRef :$row) { return join('-', map { $row->{$_} } @{$self->id_cols}); } - - -sub tokenify { - my ($self, $string) = @_; - - $string =~ s/\s+$//; - $string =~ s/[,\.\-\+]//g; - $string =~ s/^\s+//; - $string =~ s/ /-/g; - $string = lc($string); - return $string; -} - -sub clean_rs { - my $self = shift; - - return $self->result_source->resultset; -} 1; diff --git a/t/custom_methods.t b/t/custom_methods.t index 1ece36a..9ed2ad9 100644 --- a/t/custom_methods.t +++ b/t/custom_methods.t @@ -1,6 +1,6 @@ #!perl -use Test::More tests => 2; +use Test::More tests => 3; use lib qw(t/lib); use DBICTest; use Data::Dumper; @@ -10,7 +10,6 @@ ok(my $schema = DBICTest->init_schema(), 'got schema'); { my $artist_rs = $schema->resultset('Artist')->order_by(col => 'artistid')->display(); - warn Dumper($artist_rs); is_deeply($artist_rs, [ { 'artistid' => '1',