On Tue, 24 Apr 2007, Eduard Giménez wrote:
Hi,
I'm working on a existing DB which has some data spanned across several
tables. For example each user has an entry on the table "users" and on the
"user_data" table. I know that it's not he best option, but It's how the DB
is and I can change it :(
Currently to add a new user I do (on Catalyst, btw):
$u = $c->model('myDB::users')->create( { email => $email, active => 1,
...});
$u->create_related('user_data', {field01 => $field1, field02 => $field02,
...});
I would like to do something similar what is shown at [1]
$c->model('myDB::users')->create( { email => $email,
active => 1,
...
user_data => {field01 =>
$field1,
field02 =>
$field02,
...},
} );
From that [2] Matt's message I undersant that this feature was going to be
merged. Is that true? Has been already merged? On which DBIx::Class version?
TIA,
[1] http://www.mail-archive.com/[email protected]/msg02624.html:
[2] http://www.mail-archive.com/[email protected]/msg02671.html
No, it hasn't.. it's lurking in the bulk_create branch, looking for more
tuits, and some nice people to write more scary tests to stress it.
What you've shown does work.. its find_or_create type stuff that doesnt
yet.
Jess
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/