]> git.decadent.org.uk Git - maypole.git/commitdiff
Smarter remapping of column names
authorSimon Cozens <simon@simon-cozens.org>
Thu, 19 Feb 2004 13:59:10 +0000 (13:59 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 19 Feb 2004 13:59:10 +0000 (13:59 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@67 48953598-375a-da11-a14b-00016c27c3ee

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