[Dbix-class] create failures with has_one

Dermot paikkos at googlemail.com
Mon Oct 19 14:59:40 GMT 2009


2009/10/19 Wallace Reis <wallace at reis.org.br>:
> On 15/10/2009, at 21:08, Dermot wrote:
>>>>>> my $record = {
>>>>>>       'validation_pass' => 1,
>>>>>>       'files' => [],
>>>>>>       'active' => 1,
>>>>>>       'name' => 'Gustav MR',
>>>>>>       'clipdata' => [
>>>>>>                       {
>>>>>>                         'contrib_id' => 2,
>>>>>>                       }
>>>>>>                     ],
>>>>>>       'contrib_id' => 2,
>>>>>>     };
>>>>>>
>>>>>
>>>>> Use a HashRef for clipdata rel instead of a ArrayRef.
>
> Here, you should note that currently find (and update) part of *_or_create
> methods will fail for nested relations, so you need to call
> find(update)_or_create for relationships separately.

That might explain why, even under 0.08112, I get
"DBIx::Class::ResultSet::find_or_create(): new_result needs a hash..."
when I use a nested structure. Are there any methods I can use that
will allow me to create new, nested rows?


>> I would really, really love to do a doc patch if I knew how. Mostly
>> because that's all I feel I have the ability to do. However I have no
>> experience of how to create patches. I guess it's a similar to `svn
>> diff > ...`. Is there something on the Advent Calendar's or similar
>> that might show me?
>
> Not sure, but a "svn diff" output or a "svk ci -P" patch is fine.


Thanx for this tip. I'd better get my facts right before I submit.
Dp.



More information about the DBIx-Class mailing list