[Dbix-class] possible bug in DBIx::Class::Row
Peter Rabbitson
rabbit+dbic at rabbit.us
Mon Jun 8 17:49:03 GMT 2009
Oleg Pronin wrote:
> in DBIx::Class::Row::insert
>
> if(!$self->{_rel_in_storage}) {
> #heavy code
> }
>
> #insert code
>
>
> Example:
>
> $obj1 = $rs->new({...});
> $obj2 = $obj1->new_related('abc', {..});
>
>
> $obj1->insert; #ok
>
> #this cause 'heavy code' to execute because $self->{_rel_in_storage} is undefined although $obj1 has been inserted in previous line
> $obj2->insert;
>
>
> I think _rel_in_storage should be updated when related object is inserted or should be evaluated at insert
>
Have you had a chance to try some code? Can you share it? (granted it
passes existing tests)
More information about the DBIx-Class
mailing list