Skip Menu |

This queue is for tickets about the DBIx-Class-InflateColumn-Object-Enum CPAN distribution.

Report information
The Basics
Id: 74086
Status: resolved
Priority: 0/
Queue: DBIx-Class-InflateColumn-Object-Enum

People
Owner: jmmills [...] cpan.org
Requestors: ovid [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.05-TRIAL



Subject: Setting an invalid value does not croak
It would be very handy if, when setting a new value, this module would croak() instead of silently refusing to set the new value.
If I remember correctly, the inflator just relies on Object::Enum to throw an exception. I'll add a bit of validation as soon as I move the code to github. On Tue Jan 17 08:34:35 2012, OVID wrote: Show quoted text
> It would be very handy if, when setting a new value, this module would > croak() instead of silently refusing to set the new value.
Just to make sure I'm understanding this correctly: This is when you try and do a $col->set_x where x is not defined as an acceptable enumeration value? Like __PACKAGE__->add_columns( color => { data_type => 'varchar', is_enum => 1, extra => { list => [qw/red green blue/] } } ); # later $col->set_pink; # should croak On Tue Jan 17 08:34:35 2012, OVID wrote: Show quoted text
> It would be very handy if, when setting a new value, this module would > croak() instead of silently refusing to set the new value.
Altered behavior to allow Object::Enum to throw an exception. Of course this is deferred until the column inflator is called, which means doing a $rs->column($boom) won't trigger an exception immediately, only until DBIC decides to inflate it.