From 344d21e842093ff5f863923abe65377999c12c8a Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 19 Feb 2004 13:59:10 +0000 Subject: [PATCH] Smarter remapping of column names git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@67 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole/Model/Base.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.39.5