On Thu, Jun 04, 2009 at 03:38:21PM +0200, Hermida, Leandro wrote: >> If I try like the documentation says to do in create() with a has_one >> relationship, with an arrayref of hashrefs:
> arrayref is for has_many. > > For might_have/belongs_to/has_one there's only one so you just pass a > hashref. > > If the docs don't make this clear, please supply a patch :) Hi, My apologies, there must be an error in the docs http://search.cpan.org/~ribasushi/DBIx-Class-0.08103/lib/DBIx/Class/Resu ltSet.pm#create. It clearly states, "For has_many and has_one relationships, pass an arrayref of hashrefs containing the data for each of the rows to create in the foreign tables, again using the relationship name as the key." and then further down, "Example of creating a new row and also creating rows in a related has_many or has_one resultset. Note Arrayref." Also, I tried just one hashref as it made more sense and it still doesn't work, please see second error I got in original email. Leandro _______________________________________________ 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]
