X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FModel%2FCDBI%2FFromCGI.pm;h=6cb95a0bce3babb9ef71dcf334c7565d87b29395;hb=90b7b082066bee6303621aab49b166546445085c;hp=cc27533fdbe1e8e08b4a48d6ea73b0ba16079bd1;hpb=8d3f7b6c5612270c10042d8e0a9e52ad4ad54a46;p=maypole.git diff --git a/lib/Maypole/Model/CDBI/FromCGI.pm b/lib/Maypole/Model/CDBI/FromCGI.pm index cc27533..6cb95a0 100644 --- a/lib/Maypole/Model/CDBI/FromCGI.pm +++ b/lib/Maypole/Model/CDBI/FromCGI.pm @@ -279,12 +279,9 @@ sub validate_all { my $updating = $opts->{updating}; # Base case - validate this classes data - $opts->{all} ||= eval{ $r->config->{$self->table}{all_cols} } || - [$self->columns('All')]; - $opts->{required} ||= eval{ $r->config->{$self->table}{required_cols} } || - []; - my $ignore = $opts->{ignore} || eval{ $r->config->{$self->table}{ignore_cols} } - || []; + $opts->{all} ||= eval{ $r->config->{$self->table}{all_cols} } || [$self->columns('All')]; + $opts->{required} ||= eval { $r->config->{$self->table}{required_cols} || $self->required_columns } || []; + my $ignore = $opts->{ignore} || eval{ $r->config->{$self->table}{ignore_cols} } || []; push @$ignore, $self->primary_column->name if $updating; # Ignore hashes of foreign inputs. This takes care of required has_a's