Hello,
Is it possible to have DBIC populate a newly created instance with the
underlying table's defaults when a value isn't provided?
Given my code (active defaults to 1):
my $user = $db->resultset('Account')->create({
first_name =>'A',
last_name => 'User'
});
print $user->active; #undef warning
$user = $db->resultset('Account')->find($user->id);
print $user->active; #now it's populated with 1
And this thread:
http://stackoverflow.com/questions/2106504/perl-dbixclass-default-values-when-using-new
The answer appears to be no. If so, what's the reason for this behavior?
Thanks
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]