From 4e9e3b0f4af31478ebd390b034ad0b8662324adc Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 19 Feb 2004 13:48:34 +0000 Subject: [PATCH] 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 --- lib/Maypole/Model/CDBI.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 { -- 2.39.2