]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/Base.pm
Reorder the way we look for stringification column.
[maypole.git] / lib / Maypole / Model / Base.pm
index 30dacfe60015ad8227a4370fb1d5dff180c38242..dc715a0bdaeeeddcb8499f557470eca633f2c71c 100644 (file)
@@ -12,6 +12,7 @@ sub process {
     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 ]);
@@ -124,7 +125,7 @@ Return a hash mapping column names with human-readable equivalents.
 
 sub column_names { my $class = shift; map { 
         my $col = $_;
-        $col =~ s/_+(\w)?/ \U\1/g;
+        $col =~ s/_+(\w)?/ \U$1/g;
         $_ => ucfirst $col } $class->columns }
 
 =head2 description