]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/Base.pm
Smarter remapping of column names
[maypole.git] / lib / Maypole / Model / Base.pm
index 12bb71d24e614cd0e66d87043c2bc6b4108fcbfb..9d673c61858c69061c5e24ab30c3c4be2a0c3849 100644 (file)
@@ -115,7 +115,10 @@ Return a hash mapping column names with human-readable equivalents.
 
 =cut
 
-sub column_names { my $class = shift; map { $_ => ucfirst $_ } $class->columns }
+sub column_names { my $class = shift; map { 
+        my $col = $_;
+        $col =~ s/_+(\w)?/ \U\1/g;
+        $_ => ucfirst $col } $class->columns }
 
 =head2 description