X-Git-Url: https://git.decadent.org.uk/gitweb/?p=maypole.git;a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI.pm;h=2045d2ea94de5df2946339a93b57f706bacd18ae;hp=e65caa2ba46f85ad3eac4002409c6a1e55992aa1;hb=d3bd3060bf3f11775d9f40ee983f71949404f794;hpb=abb63001d28afe34e807dbd4449feaded558c528 diff --git a/lib/Maypole/Model/CDBI.pm b/lib/Maypole/Model/CDBI.pm index e65caa2..2045d2e 100644 --- a/lib/Maypole/Model/CDBI.pm +++ b/lib/Maypole/Model/CDBI.pm @@ -686,23 +686,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