]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/TT.pm
Miscellaneous fixes.
[maypole.git] / lib / Maypole / View / TT.pm
index babd0f457a9260735ccd438eb88c5b2ce2c00837..47999a4692460dc5137c53bbdd8e3d3dd5e223e7 100644 (file)
@@ -1,4 +1,4 @@
-package Apache::MVC::View::TT;
+package Maypole::View::TT;
 use Apache::Constants;
 use Lingua::EN::Inflect;
 use Template;
@@ -12,7 +12,6 @@ sub new { bless {}, shift } # Not worth having
 sub _tt {
     my ($self, $r) = @_;
     my $root = $r->{ar}->document_root . "/". $r->{ar}->location;
-    warn "Root was $root";
     Template->new({ INCLUDE_PATH => [
         $root,
         ($r->model_class && File::Spec->catdir($root, $r->model_class->moniker)),
@@ -34,7 +33,7 @@ sub _args {
     if ($class) { 
         $args{classmetadata} = {
             name => $class,
-            columns => [ $class->columns ],
+            columns => [ $class->display_columns ],
             colnames => { $class->column_names },
             related_accessors => [ $class->related($r) ],
             moniker => $class->moniker,
@@ -47,7 +46,7 @@ sub _args {
         if (@{$r->objects || []} > 1) { 
             $args{$r->model_class->plural_moniker} = $r->objects;
         } else {
-            ($args{$r->model_class->moniker}) = @{$r->objects};
+            ($args{$r->model_class->moniker}) = @{$r->objects ||[]};
         }
     }