[Dbix-class] create failures with has_one

Wallace Reis wallace at reis.org.br
Wed Dec 9 22:14:35 GMT 2009


On 09/12/2009, at 13:38, Dermot wrote:
> 2009/10/19 Dermot <paikkos at googlemail.com>:
>> 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.
> 
> Is this still true? At least of 0.08114.
> Dp.

Yes, and that applies to the problem you described in another thread (about dupes).

--
   wallace reis/wreis         Catalyst and DBIx::Class consultancy with a clue
   Software Engineer          and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
http://www.shadowcat.co.uk     http://www.linkedin.com/in/wallacereis


More information about the DBIx-Class mailing list