On 1/20/07, Octavian Rasnita <[EMAIL PROTECTED]> wrote:
So first I need to insert the user, then to search the "user" table in order
to get its ID, then loop and insert each role in the "role" table.
Isn't there an easier method?
$schema->txn_do( sub {
my $user = $schema->resultset('User')->create($user_data);
$user->add_to_roles( $_ ) for @roles;
} );
Or something along these lines, according to your specific situation.
-Nilson Santos F. Jr.
_______________________________________________
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]/