From: Brandon L. Black Date: Wed, 1 Feb 2006 04:26:48 +0000 (+0000) Subject: moved $target::schema definition from compose_namespace() to compose_connection() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ecceadffaefdd6a2b8b41a2ec1e108fe25d57771;p=dbsrgits%2FDBIx-Class-Historic.git moved $target::schema definition from compose_namespace() to compose_connection() --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 59fca81..b3f8330 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -247,6 +247,11 @@ sub compose_connection { } my $schema = $self->compose_namespace($target, $base); + { + no strict 'refs'; + *{"${target}::schema"} = sub { $schema }; + } + $schema->connection(@info); foreach my $moniker ($schema->sources) { my $source = $schema->source($moniker); @@ -275,8 +280,6 @@ sub compose_namespace { } { no strict 'refs'; - *{"${target}::schema"} = - sub { $schema }; foreach my $meth (qw/class source resultset/) { *{"${target}::${meth}"} = sub { shift->schema->$meth(@_) };