I've got some SET columns which RDBO seems to be parsing fine, since  
the column() values() are set okay, but it accepts things that aren't  
in values(). Bug? Expected behaviour?

Currently I'm wrapping my set columns with the moral equivalent of:

sub some_column {
     my $self = shift;
     if ( @_ ) {
         my $expected_values = $self->meta->column( 'some_column' )- 
 >values;
         my %is_ok = map { $_ => 1 } @$expected_values;
         my @new_values= ref $_[ 0 ] ? @{ $_[ 0 ] } : @_;
         croak "@new_values not legal (should be in @$expected_values)"
           if @new_values && notall { $is_ok{ $_ } } @new_values;
     }
     return $self->_some_column( @_ );
}

which is a little clunky :-)

Adrian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to