]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
fixed bug 16869 - forced inheritance of model
[maypole.git] / lib / Maypole.pm
index 85d471f33f43369b3d94370cc672aad065d47d10..c18f69567d2affce8ff5b8a9facd290ccc07a0fc 100644 (file)
@@ -306,15 +306,16 @@ sub setup_model
     
     foreach my $subclass ( @{ $config->classes } ) 
     {
-        no strict 'refs';
-        unshift @{ $subclass . "::ISA" }, $config->model;
-        
-        # Load custom model code, if it exists - nb this must happen after the 
-        # unshift, to allow code attributes to work, but before adopt(),  
-        # in case adopt() calls overridden methods on $subclass
-        $class->load_model_subclass($subclass);
-        
-        $config->model->adopt($subclass) if $config->model->can("adopt");
+      next if $subclass->isa("Maypole::Model::Base");
+      no strict 'refs';
+      unshift @{ $subclass . "::ISA" }, $config->model;
+      
+      # Load custom model code, if it exists - nb this must happen after the 
+      # unshift, to allow code attributes to work, but before adopt(),  
+      # in case adopt() calls overridden methods on $subclass
+      $class->load_model_subclass($subclass);
+      
+      $config->model->adopt($subclass) if $config->model->can("adopt");
     }
 }
 
@@ -443,16 +444,11 @@ sub handler : method
     $self->get_user;
     
     my $status = $self->handler_guts;
-    
-    # moving this here causes unit test failures - need to check why
-    # before committing the move
-    #$status = $self->__call_process_view unless $self->output;
-    
     return $status unless $status == OK;
     
     # TODO: require send_output to return a status code
     $self->send_output;
-    
+
     return $status;
 }