]> git.decadent.org.uk Git - maypole.git/commitdiff
Only stringify by the "name" column if there is one!
authorSimon Cozens <simon@simon-cozens.org>
Thu, 19 Feb 2004 13:48:34 +0000 (13:48 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Thu, 19 Feb 2004 13:48:34 +0000 (13:48 +0000)
git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@65 48953598-375a-da11-a14b-00016c27c3ee

lib/Maypole/Model/CDBI.pm

index b2e592973fa875c2b33ca60d23913335d647d636..74653dc6f2d091a4a3638713d8e5c2bfce397def 100644 (file)
@@ -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 {