From: Simon Cozens Date: Thu, 19 Feb 2004 13:48:34 +0000 (+0000) Subject: Only stringify by the "name" column if there is one! X-Git-Tag: 2.10~297 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=4e9e3b0f4af31478ebd390b034ad0b8662324adc;hp=f9f34047115475e7ca94d8c53273d1b3388cc33d;p=maypole.git Only stringify by the "name" column if there is one! git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@65 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Model/CDBI.pm b/lib/Maypole/Model/CDBI.pm index b2e5929..74653dc 100644 --- a/lib/Maypole/Model/CDBI.pm +++ b/lib/Maypole/Model/CDBI.pm @@ -65,7 +65,9 @@ sub delete :Exported { sub adopt { my ($self, $child) = @_; $child->autoupdate(1); - $child->columns( Stringify => qw/ name / ); + if (grep { $_ eq "name" } $child->columns) { # Common case + $child->columns( Stringify => qw/ name / ); + } # Otherwise, work it out for yourself. } sub search :Exported {