]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/TT.pm
Belt and braces.
[maypole.git] / lib / Maypole / View / TT.pm
index babd0f457a9260735ccd438eb88c5b2ce2c00837..614943414aae4b560f64c0ba2c9f365633e9e831 100644 (file)
@@ -1,4 +1,4 @@
-package Apache::MVC::View::TT;
+package Maypole::View::TT;
 use Apache::Constants;
 use Lingua::EN::Inflect;
 use Template;
@@ -34,7 +34,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 +47,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 ||[]};
         }
     }