Hi all,

We have a field in a table with an enum comprised of the values 'p', 's', and 
't'.  It's allowed to be NULL.  In my object, I've defined it as:

  priority => { 
    type   => 'enum', 
    values => [qw/ p s t /],
  },

In my tests, I have the following snippet:

     $ip->priority('p');
    throws_ok { $ip->save } 'Donhost::Exception::Fatal::IP',
      'Saving an ip with a priority and no server is fatal';

    $ip->priority(undef);
    diag "$ip priority is ".$ip->priority ." and reverse_name is "
      .$ip->reverse_name;

    $ip->reverse_name('another.url');
    diag "$ip priority is ".$ip->priority ." and reverse_name is "
      .$ip->reverse_name;

And this produces:

  ok 6 - Saving an ip with a priority and no server is fatal
  # 212.241.176.212 priority is p and reverse_name is some.url
  # 212.241.176.212 priority is p and reverse_name is another.url

In other words, trying to set the enum to a null value fails.  I've tried 
adding 'undef' the the column definition in my class, but this also has no 
effect.  What am I missing?

Cheers,
Ovid

-- 
Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/




-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to