From: Devin Austin Date: Thu, 20 Jan 2011 23:56:18 +0000 (-0700) Subject: instead of WITH, using +, and fixed up regex for naming X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51e17d692ac1e42978b39b139cabef3fad06f954;p=dbsrgits%2FDBIx-Class.git instead of WITH, using +, and fixed up regex for naming --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 574bc4b..f366ae8 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -1890,8 +1890,8 @@ sub inject_resultset_components { # this generation of class bit needs to go into CCC my @normalized = @components; - $_ =~ s/\W/_/g for @normalized; - my $class = $self->resultset_class . "::WITH::" . join ("::", @normalized); + $_ =~ s/[\W_]+/_/g for @normalized; + my $class = $self->resultset_class . "::+::" . join ("::", @normalized); Class::C3::Componentised->inject_base($class, $self->resultset_class); $self->resultset_class($class); diff --git a/t/resultset/components.t b/t/resultset/components.t index e23ea44..2c8eb67 100644 --- a/t/resultset/components.t +++ b/t/resultset/components.t @@ -11,7 +11,7 @@ my $schema = DBICTest->init_schema; isa_ok $schema->resultset('Artist'), 'A::Useless', 'Artist RS'; ok !$schema->resultset('CD')->isa('A::Useless'), 'CD RS is not A::Useless'; -my @classes = ('DBICTest::BaseResultSet::WITH::_A__Useless::_A__MoarUseless', +my @classes = ('DBICTest::BaseResultSet::+::_A_Useless::_A_MoarUseless', 'A::Useless', 'A::MoarUseless', 'DBICTest::BaseResultSet',