X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema.pm;h=ddef11032587eaa87fe366cf45454d872f64ffe9;hb=ddc0a6c89d212433eb5716b2aa963f63b1f348d1;hp=1aa36cff592c07a69cd38bddf4965c81df6258fb;hpb=c959e8d06362537fbc865d703786b399d0806212;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 1aa36cf..ddef110 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -7,6 +7,7 @@ use DBIx::Class::Exception; use Carp::Clan qw/^DBIx::Class/; use Scalar::Util qw/weaken/; use File::Spec; +use Sub::Name (); require Module::Find; use base qw/DBIx::Class/; @@ -535,7 +536,8 @@ more information. my $schema = $self->compose_namespace($target, $base); { no strict 'refs'; - *{"${target}::schema"} = sub { $schema }; + my $name = join '::', $target, 'schema'; + *$name = Sub::Name::subname $name, sub { $schema }; } $schema->connection(@info); @@ -606,8 +608,8 @@ sub compose_namespace { no strict 'refs'; no warnings 'redefine'; foreach my $meth (qw/class source resultset/) { - *{"${target}::${meth}"} = - sub { shift->schema->$meth(@_) }; + my $name = join '::', $target, $meth; + *$name = Sub::Name::subname $name, sub { shift->schema->$meth(@_) }; } } return $schema;