From: Simon Cozens Date: Thu, 19 Feb 2004 13:59:10 +0000 (+0000) Subject: Smarter remapping of column names X-Git-Tag: 2.10~295 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=344d21e842093ff5f863923abe65377999c12c8a;p=maypole.git Smarter remapping of column names git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@67 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index 12bb71d..9d673c6 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -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