]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Apache/MVC.pm
General restructuring, and a delete method which doesn't quite work yet.
[maypole.git] / lib / Apache / MVC.pm
index 25a8adb0c6dc9d47259624b433d5c4a3fa20e43a..8ed51bf1c9108a353b0bb2f05750951ab22d5188 100644 (file)
@@ -50,7 +50,7 @@ sub init {
     $config->{display_tables} ||= [ $class->config->{loader}->tables ];
     for my $subclass (@{$config->{classes}}) {
         no strict 'refs';
-        push @{$subclass."::ISA"}, $class->config->{model};
+        unshift @{$subclass."::ISA"}, $class->config->{model};
         $config->{model}->adopt($subclass)
            if $config->{model}->can("adopt");
     }
@@ -106,16 +106,21 @@ sub is_applicable {
     my $self = shift;
     my $config = $self->config;
     my %ok = map {$_ => 1} @{$config->{display_tables}};
+    warn "We don't have that table ($self->{table})"
+        unless $ok{$self->{table}};
     return DECLINED() unless exists $ok{$self->{table}};
 
     # Does the action method exist?
+    # XXX We should set the method class to the class for the table
     my $cv = $self->model_class->can($self->{action});
+    warn "We don't have that action ($self->{action})" unless $cv;
     return DECLINED() unless $cv;
 
     # Is it exported?
     $self->{method_attribs} = join " ", attributes::get($cv);
+    do { warn "$self->{action} not exported";
     return DECLINED() 
-     unless $self->{method_attribs} =~ /\bExported\b/i;
+     unless $self->{method_attribs} =~ /\bExported\b/i;
     return OK();
 }