]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/CDBI.pm
"If you set a template in the authenticate method, then the model's action will not...
[maypole.git] / lib / Maypole / Model / CDBI.pm
index b2e592973fa875c2b33ca60d23913335d647d636..c7621d2c493491c33415dd7f021940395687e13d 100644 (file)
@@ -65,11 +65,14 @@ 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 {
-    return shift->SUPER::search(@_) if caller eq "Class::DBI"; # oops
+    return shift->SUPER::search(@_) if caller ne "Maypole::Model::Base";
+                                    # A real CDBI search.
     my ($self, $r) = @_;
     my %fields = map {$_ => 1 } $self->columns;
     my $oper = "like"; # For now