]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Model/CDBI.pm
minor bug fixes.
[maypole.git] / lib / Maypole / Model / CDBI.pm
index e65caa2ba46f85ad3eac4002409c6a1e55992aa1..60619a0e807864454e2d7109955337c957171860 100644 (file)
@@ -352,8 +352,7 @@ sub related_class {
 
   $class->related_meta($col);
 
-Given a column  associated with a relationship it will return the relatation
-ship type and the meta info for the relationship on the column.
+Returns the hash ref of relationship meta info for a given column.
 
 =cut
 
@@ -363,7 +362,7 @@ sub related_meta {
     my $class_meta = $self->meta_info;
     if (my ($rel_type) = grep { defined $class_meta->{$_}->{$accssr} }
         keys %$class_meta)
-    { return  $rel_type, $class_meta->{$rel_type}->{$accssr} };
+    { return  $class_meta->{$rel_type}->{$accssr} };
 }
 
 
@@ -686,23 +685,16 @@ sub column_default {
        my $info = $class->_column_info->{$col} || 
                           eval { $class->_isa_class($col)->_column_info($col) } ||
                           return '';
-
+       
     my $def = $info->{COLUMN_DEF};
-    $def = '' unless defined $def;
-
-    # exclude defaults we don't want to display-- may need some additions here
-    if ( $class->column_type($col)  =~ /^BOOL/i ) {
-            $def = $def ? 1 : 0; # allow 0 or 1 for bool cols
-    }
-    else {
-        $def = $def =~ /(^0000-00-00.*$|^0[0]*$|^0\.00$|CURRENT_TIMESTAMP|NULL)/i ? '' : $def ;
-    }
-    return $def;
+    $def = '' unless defined $def; # is this good?
+       return $def;
 }
 
 
 
+
+
 =head2 get_classmetadata
 
 Gets class meta data *excluding cgi input* for the passed in class or the