From: Roman F Date: Fri, 10 Jun 2011 03:00:04 +0000 (-0400) Subject: Fixed a bug in pluralization. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=867277b344da8b93c7c539ec7d156ea7faae96af;p=dbsrgits%2FDBIx-Class-Schema-ResultSetAccessors.git Fixed a bug in pluralization. --- diff --git a/lib/DBIx/Class/Schema/ResultSetAccessors.pm b/lib/DBIx/Class/Schema/ResultSetAccessors.pm index 63b741d..473d3e3 100644 --- a/lib/DBIx/Class/Schema/ResultSetAccessors.pm +++ b/lib/DBIx/Class/Schema/ResultSetAccessors.pm @@ -53,7 +53,7 @@ sub resultset_accessor_name { sub pluralize_resultset_accessor_name { my ($self, $original) = @_; - return join ' ', split /\s+/, + return join '_', split /\s+/, Lingua::EN::Inflect::Phrase::to_PL(join ' ', split /_/, $original); } diff --git a/t/basic.t b/t/basic.t index f3c3f81..268e549 100644 --- a/t/basic.t +++ b/t/basic.t @@ -16,7 +16,7 @@ ok my $schema1 = MyApp1::Schema->connect('dbi:SQLite:dbname=:memory:', '', ''), 'Got schema 1'; isa_ok $schema1->resultset('Artist'), 'DBIx::Class::ResultSet'; -can_ok $schema1, qw/cds artists/; +can_ok $schema1, qw/cds artists liner_notes/; isa_ok $schema1->artists, 'DBIx::Class::ResultSet'; # generic resultset isa_ok $schema1->cds, 'MyApp1::Schema::ResultSet::CD'; # custom ResultSet