]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/Base.pm
Remove "name" magic, replace with "stringify_column" magic.
[maypole.git] / lib / Maypole / Model / Base.pm
index 9d673c61858c69061c5e24ab30c3c4be2a0c3849..a9b3a32a7b9b57ccb6d13f652db6175a1b94fc48 100644 (file)
@@ -8,8 +8,16 @@ sub edit :Exported { }
 
 sub process {
     my ($class, $r) = @_;
-    $r->template( my $method = $r->action );
-    $r->objects([ $class->retrieve(shift @{$r->{args}}) ]);
+    my $method = $r->action;
+    return if $r->{template}; # Authentication has set this, we're done.
+
+    $r->{template} = $method;
+    $r->objects([]);
+    my $obj = $class->retrieve( $r->{args}->[0] );
+    if ($obj) {
+        $r->objects([ $obj ]);
+        shift @{$r->{args}};
+    }
     $class->$method($r);
 }