in reply to Default column values in DBIx::Class
To tell the object "you're not current" and have it reloaded from the database:
$row->discard_changes;
To set the default value from your DBIx::Class object instead of from the database, and avoid the whole problem...
package MyDB::T; use base qw( DBIx::Class ); # setup stuff ... sub new { my ( $class, $attrs ) = @_; $attrs->{ 'i' } = 3 unless defined $attrs->{ 'i' }; return $class->next::method( $attrs ); }
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Default column values in DBIx::Class
by kyle (Abbot) on Jan 12, 2008 at 03:51 UTC |