]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/View/Base.pm
change template path to only look for custom, factory, etc on first/only path provided
[maypole.git] / lib / Maypole / View / Base.pm
index 07564c2b8c5b065e008eb36e8ccae347a6962883..81e50446693305c9491e603fe0d46f20e7b11867 100644 (file)
@@ -15,6 +15,7 @@ sub paths {
        $root = [ $root ];
     }
     my @output = ();
+    my $i = 0;
     foreach my $path (@$root) {
        push(@output,
             (
@@ -22,9 +23,10 @@ sub paths {
              && File::Spec->catdir( $path, $r->model_class->table )
              )
             );
-       push(@output, File::Spec->catdir( $path, "custom" ));
+       push(@output, File::Spec->catdir( $path, "custom" )) unless ($i);
        push(@output, $path);
-       push(@output, File::Spec->catdir( $path, "factory" ));
+       push(@output, File::Spec->catdir( $path, "factory" )) unless ($i);
+       $i = 1;
     }
 
     return grep( $_, @output);