Base takes namespace from self if object
Matt S Trout [Wed, 31 May 2006 01:32:21 +0000 (01:32 +0000)]
lib/Catalyst/Base.pm

index 0671838..16eae62 100644 (file)
@@ -85,7 +85,8 @@ Determine the namespace for actions in this component.
 
 sub action_namespace {
     my ( $self, $c ) = @_;
-    return $self->config->{namespace} if exists $self->config->{namespace};
+    my $hash = (ref $self ? $self : $self->config);
+    return $hash->{namespace} if exists $hash->{namespace};
     return Catalyst::Utils::class2prefix( ref($self) || $self,
         $c->config->{case_sensitive} )
       || '';