]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/Base.pm
made db_colinfo test less fragile, changed test on @ISA to work with different ordering
[maypole.git] / lib / Maypole / View / Base.pm
index a2718c47e53d34f51aba11ccbc0bd99e618d2823..277a0c93d95dcb30db2649acd57db9f1548e7957 100644 (file)
@@ -1,4 +1,5 @@
 package Maypole::View::Base;
+use Class::C3;
 use File::Spec;
 use UNIVERSAL::moniker;
 use strict;
@@ -19,7 +20,7 @@ sub paths {
        push(@output,
             (
               $r->model_class
-             && File::Spec->catdir( $path, $r->model_class->moniker )
+             && File::Spec->catdir( $path, $r->model_class->table )
              )
             );
        push(@output, File::Spec->catdir( $path, "custom" ));
@@ -41,10 +42,11 @@ sub vars {
         request => $r,
         objects => $r->objects,
         base    => $base,
-        config  => $r->config
-
-          # ...
+        config  => $r->config,
     );
+
+    $args{object} = $r->object if ($r->can('object'));
+
     if ($class) {
         my $classmeta = $r->template_args->{classmetadata} ||= {};
         $classmeta->{name}              ||= $class;